From 47f63a64a7dfccef08ecf03e510fac1938d1cf38 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Wed, 10 Sep 2025 15:07:50 +0800 Subject: [PATCH] 'commit' --- Routes/BigScreen.py | 19 +++++++++++++++++++ Routes/__pycache__/BigScreen.cpython-310.pyc | Bin 0 -> 705 bytes Routes/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 135 bytes Start.py | 17 +++-------------- 4 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 Routes/__pycache__/BigScreen.cpython-310.pyc create mode 100644 Routes/__pycache__/__init__.cpython-310.pyc diff --git a/Routes/BigScreen.py b/Routes/BigScreen.py index e69de29..d7f1051 100644 --- a/Routes/BigScreen.py +++ b/Routes/BigScreen.py @@ -0,0 +1,19 @@ +from fastapi import APIRouter + +# 创建 APIRouter 实例 +router = APIRouter(prefix="/bigscreen", tags=["大屏展示"]) + +# 定义根路由,返回 helloWorld +@router.get("/") +async def root(): + return {"message": "helloWorld"} + +# 定义一个 helloWorld 路由 +@router.get("/hello") +async def hello_world(): + return {"message": "helloWorld"} + +# 定义一个带有参数的路由 +@router.get("/hello/{name}") +async def hello_name(name: str): + return {"message": f"helloWorld, {name}!"} \ No newline at end of file diff --git a/Routes/__pycache__/BigScreen.cpython-310.pyc b/Routes/__pycache__/BigScreen.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6577c1fa05143282b520f6f9a68c6cb3751834c GIT binary patch literal 705 zcmZ`$&ubGw6rNw*-E6WkE&T&3o)*R2MWhxlUP5UOrAwf!naOr_lMOQ)v{Av*LQmq! zlL!_HrN>^qiT}l1C5UHlIr-iMNf3N6Z{EB&^S$qVQ$|rpz|QY{J0gsbA9z?b0f%i^ zCIKgjqy-t$gi@lYWRho8iuWvGihbd7?Se{A`e)>nCcs1yy!&*ooK#9r!}ha0GkvYpXwrb{?DA@M^I>-L@#p2&m|1VE z)gXUmMU`e|PTPG%ST&f3e24WLM?9et80WN0u6f7$LuE{wsU$p7MN#gTx{%jI*WlvP z&F?;W(31v=FM0=)Q70Yk>hihjS3O72^mg*B>*(DdA6uczvhuMVYR29LOxGcpdTrO@ zzwES!P4VHf^Gbx=ZQVf}zC@a+gmx~1Xc{fx+pkCIP`$MRw?2i+U&9y~p%P{T+(L;r zY(a`}^rj4Z<_qOKrw&M{~-Gt)5oEFL*V!w5SUQFF$x&^0B99VylnkpUV z8vnt1+I_0!nW~&H8tGeZD(zmZz`I{?a|aKHrJNM%5e{JxxIvmc;2{kJu1)#}Ng`kf`v*4GeGoX5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!HPi&acYad>`F zc1&bxo?l{KKv8~HYH~?TP=0AiYH>__d}dx|NqoFsLFFwDo80`A(wtN~kQv2HK!Sw< E058%VEdT%j literal 0 HcmV?d00001 diff --git a/Start.py b/Start.py index 8f15a62..cb7032f 100644 --- a/Start.py +++ b/Start.py @@ -2,24 +2,13 @@ from fastapi import FastAPI import uvicorn +from Routes.BigScreen import router as bigscreen_router # 创建 FastAPI 应用实例 app = FastAPI(title="云南教育决策研究服务系统", description="云南省教育数据分析和可视化平台") -# 定义根路由,返回 helloWorld -@app.get("/") -async def root(): - return {"message": "helloWorld"} - -# 定义一个 helloWorld 路由 -@app.get("/hello") -async def hello_world(): - return {"message": "helloWorld"} - -# 定义一个带有参数的路由 -@app.get("/hello/{name}") -async def hello_name(name: str): - return {"message": f"helloWorld, {name}!"} +# 包含大屏展示路由 +app.include_router(bigscreen_router) # 主程序入口 if __name__ == "__main__":