first init
This commit is contained in:
18
core/routers/card/services.py
Normal file
18
core/routers/card/services.py
Normal 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
|
||||
Reference in New Issue
Block a user