nb
This commit is contained in:
@@ -16,6 +16,11 @@ def get_grade(stu_id: int,db=Depends(get_db)):
|
||||
|
||||
@gradeAPI.post('/{stu_id}',response_model=GradeResponse,summary='添加学生成绩')
|
||||
def post_grade(o:GradeRequest=Form(),db=Depends(get_db)):
|
||||
|
||||
exist_obj = get_grade_dao(db,o.stu_id)
|
||||
if exist_obj:
|
||||
raise HTTPException(status_code=409, detail="该学生此考核序次成绩已存在!")
|
||||
|
||||
d=o.model_dump()
|
||||
r=add_grade_dao(g=d,db=db)
|
||||
if not r:
|
||||
|
||||
Reference in New Issue
Block a user