修改删除模块debug

This commit is contained in:
2026-09-21 16:18:59 +08:00
parent def4b1d2c3
commit 2bc1e58047
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ def updata_stuinfo(up:PostRequest
raise HTTPException(status_code=500, detail='没有更新!') raise HTTPException(status_code=500, detail='没有更新!')
return {'code': 200, 'totals': r, 'detail': '更新成功'} return {'code': 200, 'totals': r, 'detail': '更新成功'}
@CURD.delete('/emp',tags=['删除就业信息']) @CURD.delete('/emp/{id}',tags=['删除就业信息'])
def delete_stuinfo(id:int def delete_stuinfo(id:int
,db=Depends(get_db)): ,db=Depends(get_db)):
rows = delete_emp_dao(id, db) rows = delete_emp_dao(id, db)
+1 -1
View File
@@ -100,7 +100,7 @@ def get_emp_dao(
def delete_emp_dao(id,db): def delete_emp_dao(id,db):
try: # 删除有返回值,删除的行数 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: except Exception as e:
print(f'删除失败,{e}') print(f'删除失败,{e}')