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