123456789101112131415161718192021222324252627 |
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- from app.call_center.crud.crud_mismatch_records import mismatch_records_dao
- from app.call_center.schema.mismatch_records import GetMismatchRecordsByIdParam, CreateMismatchRecordsParam, \
- UpdateMismatchRecordsParam
- from database.db_mysql import async_db_session
- from model.mismatch_records import MismatchRecords
- class MismatchRecordsService:
- @staticmethod
- async def get_select_by_id(*, obj: GetMismatchRecordsByIdParam) -> MismatchRecords | None:
- async with async_db_session.begin() as db:
- return await mismatch_records_dao.get(db, obj)
- @staticmethod
- async def create(*, obj: CreateMismatchRecordsParam) -> None:
- async with async_db_session.begin() as db:
- await mismatch_records_dao.create(db, obj)
- @staticmethod
- async def update_ignore(*, obj: UpdateMismatchRecordsParam) -> int:
- async with async_db_session.begin() as db:
- count = await mismatch_records_dao.update_ignore(db, obj)
- return count
- mismatch_records_service: MismatchRecordsService = MismatchRecordsService()
|