2025-09-10 15:07:50 +08:00
|
|
|
from fastapi import APIRouter
|
2025-09-10 15:11:25 +08:00
|
|
|
import json
|
2025-09-10 15:42:32 +08:00
|
|
|
from Model.RenkouModel import RenkouModel
|
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-10 15:07:50 +08:00
|
|
|
router = APIRouter(prefix="/bigscreen", tags=["大屏展示"])
|
|
|
|
|
2025-09-10 15:46:18 +08:00
|
|
|
# 默认的根路由
|
2025-09-10 15:21:56 +08:00
|
|
|
@router.get("/")
|
|
|
|
async def root():
|
|
|
|
return {"message": "Welcome to YunNan Education World!"}
|
2025-09-10 15:07:50 +08:00
|
|
|
|
2025-09-10 15:21:56 +08:00
|
|
|
@router.get("/population/chart/{year}")
|
|
|
|
async def get_population_chart_config(year: str = "2024"):
|
2025-09-10 15:42:32 +08:00
|
|
|
return RenkouModel.generate_population_chart_config(year)
|
2025-09-10 15:21:56 +08:00
|
|
|
|
|
|
|
@router.get("/population/urbanization")
|
|
|
|
async def get_urbanization_rate_chart_config():
|
2025-09-10 15:42:32 +08:00
|
|
|
return RenkouModel.generate_urbanization_rate_chart_config()
|
2025-09-10 15:21:56 +08:00
|
|
|
|
2025-09-10 16:08:59 +08:00
|
|
|
@router.get("/school/preschool/chart")
|
|
|
|
async def get_preschool_education_chart_config():
|
|
|
|
return RuYuanZaiYuanModel.generate_preschool_education_config()
|
|
|
|
|
2025-09-10 20:18:01 +08:00
|
|
|
@router.get("/school/preschool/inschool/chart")
|
|
|
|
async def get_preschool_in_school_chart_config():
|
|
|
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
|
|
|
|