Merge remote-tracking branch 'origin/conding' into conding

This commit is contained in:
msj
2026-09-22 14:34:32 +08:00
17 changed files with 355 additions and 257 deletions
+5 -5
View File
@@ -4,9 +4,9 @@ from schema.student_schema import *
from util.database import get_db
StudentAPI = APIRouter()
StudentAPI = APIRouter(tags=['学生基本信息管理模块'])
@StudentAPI.get('/students',response_model=StudentPageResponse,tags=['学⽣基本信息管理模块'],summary='学生信息查询接口',description='查询学生信息')
@StudentAPI.get('/students',response_model=StudentPageResponse,summary='学生信息查询接口',description='查询学生信息')
def get_students(stu_id:int|None=None
,stu_name:str|None=None
,class_id:int|None=None
@@ -27,7 +27,7 @@ def get_students(stu_id:int|None=None
totals=total,
data=r)
@StudentAPI.put('/{stu_id}',tags=['学⽣基本信息管理模块'],summary='学生信息更新接口',description='更新学生信息')
@StudentAPI.put('/{stu_id}',summary='学生信息更新接口',description='更新学生信息')
def update_students(s:StudentRequest
,stu_id:int
,db=Depends(get_db)):
@@ -39,7 +39,7 @@ def update_students(s:StudentRequest
raise HTTPException(status_code=500, detail='没有更新')
return {'code':200,'totals':r,'detail':'更新成功'}
@StudentAPI.delete('/{stu_id}',tags=['学⽣基本信息管理模块'],summary='学生信息删除接口',description='删除学生信息')
@StudentAPI.delete('/{stu_id}',summary='学生信息删除接口',description='删除学生信息')
def del_students(stu_id:int
,db=Depends(get_db)):
rows=delete_student_dao( stu_id=stu_id,db=db )
@@ -47,7 +47,7 @@ def del_students(stu_id:int
raise HTTPException(status_code=404,detail='对象已被删除')
return {'code':200,'totals':rows,'detail':'删除成功'}
@StudentAPI.post('/students',tags=['学⽣基本信息管理模块'],response_model=StugetResponse,summary='学生信息新增接口',description='新增学生信息')
@StudentAPI.post('/students',response_model=StugetResponse,summary='学生信息新增接口',description='新增学生信息')
def add_students(s:StudentRequest
,db=Depends(get_db)):
d = s.model_dump(exclude_unset=True)