mrz
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from fastapi import APIRouter,Depends
|
||||
from fastapi import APIRouter,Depends,Query
|
||||
from dao.statistics_dao import *
|
||||
from schema.student_schema import StudentResponse
|
||||
from schema.statistics_schema import *
|
||||
@@ -7,7 +7,7 @@ from util.database import get_db
|
||||
StatisticsAPI = APIRouter()
|
||||
|
||||
@StatisticsAPI.get("/age",response_model=list[StudentResponse],tags=['统计分析模块'],summary='根据年龄查询学生信息')
|
||||
def get_students(min_age:int|None=None,max_age:int|None=None,db=Depends(get_db)):
|
||||
def get_students(min_age:int|None=Query(None,ge=0,le=150),max_age:int|None=Query(None,ge=0,le=150),db=Depends(get_db)):
|
||||
l = select_age(min_age,max_age,db)
|
||||
return l
|
||||
|
||||
|
||||
Reference in New Issue
Block a user