2025-09-11 20:22:23 +08:00
|
|
|
from fastapi import APIRouter, Query
|
2025-09-10 20:36:43 +08:00
|
|
|
|
2025-09-10 20:34:47 +08:00
|
|
|
from Model.RuYuanZaiYuanCountModel import RuYuanZaiYuanModel
|
2025-09-10 15:07:50 +08:00
|
|
|
|
2025-09-10 15:42:32 +08:00
|
|
|
# 创建APIRouter实例
|
2025-09-11 20:28:53 +08:00
|
|
|
router = APIRouter(prefix="/RuYuanZaiYuan", tags=["入校、在校人数统计"])
|
2025-09-10 15:07:50 +08:00
|
|
|
|
|
|
|
|
2025-09-11 20:22:23 +08:00
|
|
|
@router.get("/school/chart")
|
|
|
|
async def get_education_chart_config(
|
|
|
|
education_stage: str = Query(default="preschool", pattern="^(preschool|primary|junior|senior)$",
|
|
|
|
description="教育阶段: preschool(学前), primary(小学), junior(初中), senior(高中)")
|
|
|
|
):
|
|
|
|
return RuYuanZaiYuanModel.generate_preschool_education_config(education_stage)
|
|
|
|
|
|
|
|
@router.get("/school/inschool/chart")
|
|
|
|
async def get_in_school_chart_config(
|
|
|
|
education_stage: str = Query(default="preschool", pattern="^(preschool|primary|junior|senior)$",
|
|
|
|
description="教育阶段: preschool(学前), primary(小学), junior(初中), senior(高中)")
|
|
|
|
):
|
|
|
|
return RuYuanZaiYuanModel.generate_in_school_education_config(education_stage)
|
2025-09-10 16:08:59 +08:00
|
|
|
|
2025-09-10 20:18:01 +08:00
|
|
|
|
2025-09-11 14:32:15 +08:00
|
|
|
|