from fastapi import APIRouter, Query

from Model.RuYuanZaiYuanCountModel import RuYuanZaiYuanModel

# 创建APIRouter实例
router = APIRouter(prefix="/RuYuanZaiYuan", tags=["入校、在校人数统计"])


@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)



