diff --git a/stu_jiuye/CURD_api.py b/stu_jiuye/CURD_api.py index 3a1764d..f895d9a 100644 --- a/stu_jiuye/CURD_api.py +++ b/stu_jiuye/CURD_api.py @@ -66,7 +66,7 @@ def updata_stuinfo(up:PostRequest raise HTTPException(status_code=500, detail='没有更新!') return {'code': 200, 'totals': r, 'detail': '更新成功'} -@CURD.delete('/emp',tags=['删除就业信息']) +@CURD.delete('/emp/{id}',tags=['删除就业信息']) def delete_stuinfo(id:int ,db=Depends(get_db)): rows = delete_emp_dao(id, db) diff --git a/stu_jiuye/dao.py b/stu_jiuye/dao.py index e9691c7..adf4d80 100644 --- a/stu_jiuye/dao.py +++ b/stu_jiuye/dao.py @@ -100,7 +100,7 @@ def get_emp_dao( def delete_emp_dao(id,db): try: # 删除有返回值,删除的行数 - rows = db.query(Employments).filter(Employments.id == id).update( is_deleted=1 ) + rows = db.query(Employments).filter(Employments.id == id).update( {'is_deleted':1} ) except Exception as e: print(f'删除失败,{e}')