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