first init

This commit is contained in:
xingc
2025-02-18 14:26:47 +08:00
commit 48a02974fc
41 changed files with 2297 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# -*- coding = utf-8 -*-
# @Time : 2025/2/17 上午1:00
# @File : services.py
# @Software : PyCharm
# @Author : xingc
# @Desc :
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from core.db.models import SearchCardCache
async def get_cache_card_by_number(db_session: AsyncSession, *, cert_number: str) -> SearchCardCache | None:
query = select(SearchCardCache).where(SearchCardCache.cert_number == cert_number)
result = await db_session.execute(query)
card: SearchCardCache | None = result.scalar_one_or_none()
return card