This commit is contained in:
he
2026-09-21 16:28:55 +08:00
parent 9631c41579
commit 4425b99b87
4 changed files with 33 additions and 7 deletions
+12 -1
View File
@@ -2,7 +2,7 @@ from fastapi import Depends,HTTPException
from util.database import get_db
from model.grade_model import *
from model.all_model import *
def get_grade_dao( stu_id:int
@@ -13,3 +13,14 @@ def get_grade_dao( stu_id:int
return r1
else:
raise HTTPException(status_code=404,detail="学生不存在")
def add_grade_dao(o,db=Depends(get_db)):
try:
o1 = WlScore(**o)
db.add(o1)
except:
db.rollback()
return False
else:
db.commit()
return True