From 8ea5fcb5b8ba5f5c22b8caddba892ce6743f13bc Mon Sep 17 00:00:00 2001 From: Orangeeee Date: Tue, 22 Sep 2026 11:12:15 +0800 Subject: [PATCH] =?UTF-8?q?students=E6=96=87=E4=BB=B6=E5=A4=B9=E5=86=85?= =?UTF-8?q?=E6=96=B0=E5=A2=9Emain=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=95=B4?= =?UTF-8?q?=E5=90=88=E9=93=BE=E6=8E=A5=E5=88=B0=E4=B8=BBmain=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- students/main.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 students/main.py diff --git a/students/main.py b/students/main.py new file mode 100644 index 0000000..b1909a7 --- /dev/null +++ b/students/main.py @@ -0,0 +1,31 @@ +from fastapi import FastAPI +from students.api.students_api import students_api +from students.databases import * +from students.model import students_model +from contextlib import asynccontextmanager + +@asynccontextmanager +async def lifespan(app: FastAPI): + Base.metadata.create_all(engine1) + yield + engine1.dispose() + +app = FastAPI(title="学生管理系统",lifespan=lifespan) # 这里必须把上面写的加上 + +app.include_router(students_api,tags=["students"]) + + +def main(): + print("Hello from student-manage-system!") + + +if __name__ == "__main__": + import uvicorn + uvicorn.run("main:app", host="0.0.0.0", port=51000) + + """students api + IPv4 地址 . . . . . . . . . . . . : 192.168.6.40 + 默认网关. . . . . . . . . . . . . : 192.168.6.1 + """ + +