就业get次昂管的dao层和api接口

This commit is contained in:
2026-09-21 22:58:21 +08:00
parent 7216922d8d
commit 337bfce8b1
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -31,14 +31,14 @@ def create_emp_info(stu_id:int,emp:EmploymentRequest,db=Depends(get_db)):
return r
@emp_api.put('/employment/students/{stu_id}',response_model=EmploymentResponse,summary='更新学生就业信息')
def update_emp_info(emp_id:int,emp:EmploymentRequest,db=Depends(get_db)):
def update_emp_info(stu_id:int,emp:EmploymentRequest,db=Depends(get_db)):
d = emp.model_dump(exclude_unset=True)
r = update_emp_dao(emp_id,d,db)
r = update_emp_dao(stu_id,d,db)
if not r:
raise HTTPException(status_code=500,detail='更新失败!')
return {'code':200,'totals':r,'detail':'更新成功!'}
@emp_api.delete('/employment/{emp_id}',summary='删除学生就业信息')
def delete_emp_info(emp_id:int,db=Depends(get_db)):
delete_emp_dao(emp_id,db)
@emp_api.delete('/employment/{stu_id}',summary='删除学生就业信息')
def delete_emp_info(stu_id:int,db=Depends(get_db)):
delete_emp_dao(stu_id,db)
return {'code':200,'detail':'删除成功!'}