改提交不上的bud

This commit is contained in:
2026-09-22 22:32:44 +08:00
parent 737d48babc
commit 334bb237b2
5 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ tea_api = APIRouter()
@tea_api.post('/tea',response_model=TeaResponse,summary='新增老师',description='输入新增的老师信息,除去姓名外可以为空')
def add_tea(tea: NewTeaRequest=Depends(),db=Depends(get_db)):
r = add_tea_dao(tea.model_dump(),db)
r = add_tea_dao(tea.model_dump(exclude_unset=True),db)
if not r:
raise HTTPException(status_code=500,detail='添加失败!')
return TeaResponse(totals=1,data=tea.model_dump())
@@ -48,7 +48,7 @@ def delete_other_tea_dao1(t:TeaRequest=Depends(),db=Depends(get_db)):
@tea_api.post('/subject',summary='新增科目',description='输入新增的科目')
def add_sub(t:SubRequest=Depends(),db=Depends(get_db)): #开启会话窗口
r = add_subject_dao(t.model_dump(),db=db)
if not r:
if r=='已存在':
raise HTTPException(status_code=500,detail='科目已存在')
return TeaResponse(totals=len(r), data=r)