xbackend/crud/crud_api_log.py
2021-06-01 09:49:03 +08:00

15 lines
335 B
Python

from motor.motor_asyncio import AsyncIOMotorDatabase
import schemas
from crud.base import CRUDBase
__all__ = 'api_log',
class CRUDApiLog(CRUDBase):
async def insert_log(self, db: AsyncIOMotorDatabase, data_in: schemas.ApiLogInsert):
await db[self.coll_name].insert_one(data_in.dict())
api_log = CRUDApiLog('api_log')