diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index cec3896..a32a9d0 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -1983,6 +1983,7 @@ async def add_interviewee( 'job_names': user_data['job_names'], # 我们自己招聘的职位名 'times': now_time, # 创建数据日期 'read_status': 0, # 读取状态 + 'back_status': 0, # 反馈状态 'type': 'interview' # 记录的类型 }) @@ -2137,6 +2138,7 @@ async def interview_find( async def interview_teacher( request: Request, data_in: schemas.interview_teacher, + db: AsyncIOMotorDatabase = Depends(get_database), ckdb: CKDrive = Depends(get_ck_db), current_user: schemas.UserDB = Depends(deps.get_current_user) ) -> schemas.Msg: @@ -2147,6 +2149,7 @@ async def interview_teacher( WHERE uid = '{data_in.uid}' """ await ckdb.execute(sql) + await crud.interview_record.update_back_status(db, data_in.uid, data_in.teacher_back) return schemas.Msg(code=200, msg='ok', data='') diff --git a/crud/crud_interview_record.py b/crud/crud_interview_record.py index 2a848b2..f941784 100644 --- a/crud/crud_interview_record.py +++ b/crud/crud_interview_record.py @@ -25,6 +25,10 @@ class CRUDInterview(CRUDBase): async def up_interview(self, db: AsyncIOMotorDatabase, data_in: schemas.Up_hint): await self.update_many(db, {'_id': {'$in': data_in.hint_id}}, {'$set': {'read_status': 1}}) + # 修改单条面试数据的back_status + async def update_back_status(self, db: AsyncIOMotorDatabase, uid, status): + await self.update_one(db, {'uid': uid}, {'$set': {'back_status': status}}) + # 获取所有对应条件面试数据 # async def all_fields(self, db: AsyncIOMotorDatabase, data_in: schemas.Jobs): # if data_in == None: diff --git a/schemas/interview_record.py b/schemas/interview_record.py index 144aa51..6e95d4d 100644 --- a/schemas/interview_record.py +++ b/schemas/interview_record.py @@ -17,6 +17,7 @@ class interview_record(BaseModel): job_names: str # 我们自己招聘的职位名 times: str # 创建数据的时间 read_status: int # 读取状态 + back_status: int # 反馈状态 type: str # 记录的类型