1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user