This commit is contained in:
msj
2026-09-22 10:39:41 +08:00
parent 2d9ddd051a
commit dccc0b6092
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ def del_students(stu_id:int
,db=Depends(get_db)):
rows=delete_student_dao( stu_id=stu_id,db=db )
if not rows:
raise HTTPException(status_code=500,detail='没有删除')
raise HTTPException(status_code=404,detail='对象已被删除')
return {'code':200,'totals':rows,'detail':'删除成功'}
@StudentAPI.post('/students',tags=['学⽣基本信息管理模块'],response_model=StugetResponse,summary='学生信息新增接口',description='新增学生信息')
@@ -53,5 +53,5 @@ def add_students(s:StudentRequest
d=s.model_dump(exclude_unset=True)
stu_new=add_student_dao(o=d,db=db)
if not stu_new:
raise HTTPException(status_code=500,detail='添加失败')
raise HTTPException(status_code=404,detail='添加失败')
return stu_new