全部更新确认,无基础错误,各自测试各自端口bug,暂时没有自动导入数据。

This commit is contained in:
Orangeeee
2026-09-22 21:05:09 +08:00
parent 133cb530c7
commit dae4d74e31
9 changed files with 47 additions and 44 deletions
+9 -9
View File
@@ -9,16 +9,16 @@ Students_API = APIRouter()
Students_API.include_router(s_api)
# 自测接口
@asynccontextmanager
async def S_Fastapi(app: FastAPI):
Base.metadata.create_all(engine1)
yield
engine1.dispose()
app = FastAPI(title="学生管理系统", lifespan=S_Fastapi) # 这里必须把上面写的加上
if __name__ == "__main__":
# 自测接口
@asynccontextmanager
async def S_Fastapi(app: FastAPI):
Base.metadata.create_all(engine1)
yield
engine1.dispose()
app = FastAPI(title="学生管理系统", lifespan=S_Fastapi) # 这里必须把上面写的加上
app.include_router(s_api, tags=["students"])
def main():