12 lines
400 B
Python
12 lines
400 B
Python
from fastapi import APIRouter
|
|
from dao.student_dao import select_age
|
|
from schema.student_schema import StudentResponse
|
|
|
|
studentapi = APIRouter()
|
|
|
|
@studentapi.get("/age",response_model=StudentResponse,tags=['统计分析模块'],description='根据年龄查询学生信息')
|
|
def get_students(min_age:int|None=None,max_age:int|None=None):
|
|
l = select_age(min_age,max_age)
|
|
return [i for i in l]
|
|
|