21 lines
627 B
Python
21 lines
627 B
Python
from fastapi import APIRouter
|
|
import json
|
|
from Model.RenkouModel import RenkouModel
|
|
|
|
# 创建APIRouter实例
|
|
router = APIRouter(prefix="/bigscreen", tags=["大屏展示"])
|
|
|
|
# 默认的根路由
|
|
@router.get("/")
|
|
async def root():
|
|
return {"message": "Welcome to YunNan Education World!"}
|
|
|
|
@router.get("/population/chart/{year}")
|
|
async def get_population_chart_config(year: str = "2024"):
|
|
return RenkouModel.generate_population_chart_config(year)
|
|
|
|
@router.get("/population/urbanization")
|
|
async def get_urbanization_rate_chart_config():
|
|
return RenkouModel.generate_urbanization_rate_chart_config()
|
|
|