27 lines
902 B
Python
27 lines
902 B
Python
from motor.motor_asyncio import AsyncIOMotorDatabase
|
|
import schemas
|
|
from crud.base import CRUDBase
|
|
|
|
__all__ = 'operate_log',
|
|
|
|
|
|
class Operate_log(CRUDBase):
|
|
# 获取对应求职者的操作记录
|
|
async def all_log(self, db: AsyncIOMotorDatabase, data_in: schemas.get_operate_log):
|
|
return await self.find_many(db, {'user_id': data_in.user_id}, {'_id': 0})
|
|
|
|
# 修改数据
|
|
# async def update(self, db: AsyncIOMotorDatabase, data_in: schemas.AddProjectnumber):
|
|
# game = data_in.game
|
|
# add_ditch = []
|
|
# for member in data_in.ditch:
|
|
# add_ditch.append(member.dict())
|
|
# await self.update_one(db, {'game': game}, {'$set': {'ditch': add_ditch}})
|
|
|
|
# 插入数据
|
|
async def create(self, db: AsyncIOMotorDatabase, data_in: schemas.operate_log):
|
|
await self.insert_one(db, data_in.dict())
|
|
|
|
|
|
operate_log = Operate_log('operate_log')
|