分支合并,调整完毕,可以运行,可以拉取该分支进行修改bug。
This commit is contained in:
@@ -6,7 +6,7 @@ from Teachers.dao.tea_dao import *
|
||||
from Teachers.schema.tea_request import TeaRequest,NewTeaRequest
|
||||
from Teachers.schema.tea_response import TeaResponse
|
||||
|
||||
tea_api = APIRouter(tags=['老师相关接口'])
|
||||
tea_api = APIRouter()
|
||||
|
||||
@tea_api.post('/tea',response_model=TeaResponse,summary='新增老师',description='输入新增的老师信息,除去姓名外可以为空')
|
||||
def add_tea(tea: NewTeaRequest,db=Depends(get_db)):
|
||||
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
from fastapi import FastAPI,APIRouter
|
||||
from Teachers.model.tea_model import *
|
||||
from api.tea_api import tea_api
|
||||
from Teachers.api.tea_api import tea_api
|
||||
|
||||
# 合并接口
|
||||
Teachers_API = APIRouter()
|
||||
Teachers_API.include_router(tea_api)
|
||||
|
||||
# 自测接口
|
||||
app = FastAPI()
|
||||
app.include_router(tea_api)
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ from class_management.dao.class_management_dao import add_class_dao, update_clas
|
||||
from class_management.database import get_db
|
||||
from class_management.schema.class_management_request import ClassCreate, ClassResponse, ClassUpdate
|
||||
|
||||
class_api = APIRouter(prefix='/classes',tags=['班级管理模块'])
|
||||
class_api = APIRouter(prefix='/classes')
|
||||
# ,tags=['班级管理模块']
|
||||
|
||||
@class_api.post("",summary='新增班级')
|
||||
def add_class(cla:ClassCreate,db=Depends(get_db)):
|
||||
|
||||
@@ -4,10 +4,12 @@ from class_management.model.class_management_model import ClassInfo
|
||||
from class_management.database import Base,engine
|
||||
# import model
|
||||
|
||||
# 合并接口
|
||||
Classes_API = APIRouter()
|
||||
Classes_API.include_router(class_api)
|
||||
|
||||
# 自测接口
|
||||
app = FastAPI()
|
||||
|
||||
app.include_router(class_api)
|
||||
|
||||
Base.metadata.create_all(engine)
|
||||
|
||||
+4
-2
@@ -1,11 +1,13 @@
|
||||
from fastapi import FastAPI,APIRouter
|
||||
from scores.api.score_api import score_api
|
||||
from scores.database import *
|
||||
from scores.database import engine,Base
|
||||
|
||||
# 合并接口
|
||||
Scores_API = APIRouter()
|
||||
Scores_API.include_router(score_api)
|
||||
|
||||
# 自测接口
|
||||
app = FastAPI()
|
||||
|
||||
app.include_router(score_api)
|
||||
|
||||
Base.metadata.create_all(engine)
|
||||
|
||||
@@ -2,8 +2,11 @@ from fastapi import FastAPI,APIRouter
|
||||
from stu_jiuye.CURD_api import CURD
|
||||
from stu_jiuye.database import Base,engine
|
||||
|
||||
# 合并接口
|
||||
Shtudent_Jiuye = APIRouter()
|
||||
Shtudent_Jiuye.include_router(CURD)
|
||||
|
||||
# 自测接口
|
||||
app=FastAPI()
|
||||
Base.metadata.create_all(engine)
|
||||
app.include_router(CURD,tags=['就业管理系统'])
|
||||
|
||||
+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