41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
from fastapi import FastAPI
|
|
from api.example import example_router
|
|
from middleware import log_middleware
|
|
from api.statistics import statistics_router
|
|
import uvicorn
|
|
from api.student import student_router
|
|
from api.teacher import router as teacher_router,class_teacher_router
|
|
from api.magic import magic_router
|
|
|
|
app = FastAPI(title='学生管理系统')
|
|
app.middleware("http")(log_middleware)
|
|
app.include_router(magic_router)
|
|
|
|
#-------------朱婷婷--------------
|
|
from api.class_api import classes_router
|
|
app.include_router(classes_router,tags=['班级接口'],prefix="/classes")
|
|
|
|
#-------------李玉杰--------------
|
|
app.include_router(student_router,tags=['学生接口'],prefix="/students")
|
|
#-------------张义---------------
|
|
app.include_router(teacher_router,tags=['教师接口'],prefix="/teachers")
|
|
app.include_router(class_teacher_router,tags=['教师班级关系接口'],prefix="/class_teacher")
|
|
#-------------薄鑫---------------
|
|
from api import consultant
|
|
app.include_router(consultant.router)
|
|
#-------------张昕浩---------------
|
|
app.include_router(example_router)
|
|
app.include_router(magic_router)
|
|
app.include_router(statistics_router, prefix="/statistics")
|
|
|
|
#-------------曾凯---------------
|
|
from api.score import scores_router
|
|
app.include_router(scores_router, tags=['成绩接口'])
|
|
#-------------南方宇---------------
|
|
from api.employment import employment_router
|
|
app.include_router(employment_router, prefix="/employment")
|
|
#-----------主程序----------------
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run(app, host="0.0.0.0", port=23333)
|