分支合并,调整完毕,可以运行,可以拉取该分支进行修改bug。
This commit is contained in:
+3
-1
@@ -4,8 +4,11 @@ from students.databases import *
|
||||
from students.model import students_model
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
# 合并接口
|
||||
Students_API = APIRouter()
|
||||
Students_API.include_router(s_api)
|
||||
|
||||
# 自测接口
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
Base.metadata.create_all(engine1)
|
||||
@@ -13,7 +16,6 @@ async def lifespan(app: FastAPI):
|
||||
engine1.dispose()
|
||||
|
||||
app = FastAPI(title="学生管理系统",lifespan=lifespan) # 这里必须把上面写的加上
|
||||
|
||||
app.include_router(s_api,tags=["students"])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user