29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
from fastapi import APIRouter, Query
|
|
|
|
from Model.RuYuanZaiYuanCountModel import RuYuanZaiYuanModel
|
|
|
|
# 创建APIRouter实例
|
|
router = APIRouter(prefix="/RuYuanZaiYuan", tags=["大屏展示"])
|
|
|
|
# 默认的根路由
|
|
@router.get("/")
|
|
async def root():
|
|
return {"message": "Welcome to YunNan Education World!"}
|
|
|
|
@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)
|
|
|
|
|
|
|