全部更新确认,无基础错误,各自测试各自端口bug,暂时没有自动导入数据。
This commit is contained in:
+9
-9
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user