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

This commit is contained in:
he
2026-09-21 16:29:03 +08:00
5 changed files with 96 additions and 11 deletions
-1
View File
@@ -8,7 +8,6 @@ StatisticsAPI = APIRouter()
@StatisticsAPI.get("/age",response_model=list[StudentResponse],tags=['统计分析模块'],description='根据年龄查询学生信息')
def get_students(min_age:int|None=None,max_age:int|None=None,db=Depends(get_db)):
l = select_age(min_age,max_age,db)
print(l)
return l
@StatisticsAPI.get("/all",response_model=StudentResponse,tags=['统计分析模块'],description='统计每个班级的学员总数和男女生总数')
+5 -5
View File
@@ -6,7 +6,7 @@ from util.database import get_db
StudentAPI = APIRouter()
@StudentAPI.get('/',description='查询学生信息')
@StudentAPI.get('/',tags=['学⽣基本信息管理模块'],description='查询学生信息')
def get_students(stu_id:int|None=None
,stu_name:str|None=None
,class_id:int|None=None
@@ -18,7 +18,7 @@ def get_students(stu_id:int|None=None
return r
raise HTTPException(status_code=404,detail='学生不存在')
@StudentAPI.put('/{stu_id}')
@StudentAPI.put('/{stu_id}',tags=['学⽣基本信息管理模块'])
def update_students(s:StudentRequest
,stu_id:int
,db=Depends(get_db)):
@@ -28,7 +28,7 @@ def update_students(s:StudentRequest
raise HTTPException(status_code=500, detail='没有更新!')
return {'code':200,'totals':r,'detail':'更新成功'}
@StudentAPI.delete('/{stu_id}')
@StudentAPI.delete('/{stu_id}',tags=['学⽣基本信息管理模块'])
def del_students(stu_id:int
,db=Depends(get_db)):
rows=delete_student_dao( stu_id=stu_id,db=db )
@@ -36,7 +36,7 @@ def del_students(stu_id:int
raise HTTPException(status_code=500,detail='没有删除')
return {'code':200,'totals':rows,'detail':'删除成功'}
@StudentAPI.post('/',response_model=list[StugetResponse])
@StudentAPI.post('/',tags=['学⽣基本信息管理模块'],response_model=list[StugetResponse])
def add_students(s:StudentRequest
,db=Depends(get_db)):
d=s.model_dump(exclude_unset=True)
@@ -45,7 +45,7 @@ def add_students(s:StudentRequest
raise HTTPException(status_code=500,detail='添加失败')
@StudentAPI.put('/')
@StudentAPI.put('/',tags=['学⽣基本信息管理模块'])
def get_students(stu_id:int|None = None
,stu_name:str|None = None
,class_id:int|None=None