This commit is contained in:
he
2026-09-21 16:53:39 +08:00
parent e2c45057c3
commit abb7b97389
4 changed files with 10 additions and 7 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ def get_grade(stu_id: int,db=Depends(get_db)):
except Exception as e:
raise HTTPException(status_code=500,detail=f'数据库查询异常:{str(e)}')
@gradeAPI.post('/{stu_id}',summary='添加学生成绩')
@gradeAPI.post('/{stu_id}',response_model=GradeResponse,summary='添加学生成绩')
def post_grade(o:GradeRequest=Form(),db=Depends(get_db)):
d=o.model_dump()
r=add_grade_dao(g=d,db=db)
@@ -22,3 +22,4 @@ def post_grade(o:GradeRequest=Form(),db=Depends(get_db)):
raise HTTPException(status_code=400, detail='学生不存在')
return GradeResponse