2026-09-20 17:06:24 +08:00
|
|
|
from fastapi import FastAPI
|
|
|
|
|
from api.example import example_router
|
2026-09-20 19:45:36 +08:00
|
|
|
from middleware import log_middleware
|
2026-09-21 14:34:43 +08:00
|
|
|
from api.statistics import statistics_router
|
2026-09-20 17:06:24 +08:00
|
|
|
import uvicorn
|
2026-09-21 12:36:57 +08:00
|
|
|
from api.student import student_router
|
2026-09-22 10:47:28 +08:00
|
|
|
from api.teacher import router as teacher_router,class_teacher_router
|
2026-09-22 15:10:09 +08:00
|
|
|
from api.magic import magic_router
|
2026-09-22 10:47:28 +08:00
|
|
|
|
2026-09-22 18:10:06 +08:00
|
|
|
app = FastAPI(title='学生管理系统')
|
2026-09-20 19:45:36 +08:00
|
|
|
app.middleware("http")(log_middleware)
|
2026-09-22 15:10:09 +08:00
|
|
|
app.include_router(magic_router)
|
2026-09-20 19:45:36 +08:00
|
|
|
|
|
|
|
|
#-------------朱婷婷--------------
|
2026-09-21 14:17:09 +08:00
|
|
|
from api.class_api import classes_router
|
|
|
|
|
app.include_router(classes_router,tags=['班级接口'],prefix="/classes")
|
2026-09-20 19:45:36 +08:00
|
|
|
|
|
|
|
|
#-------------李玉杰--------------
|
2026-09-22 10:02:24 +08:00
|
|
|
app.include_router(student_router,tags=['学生接口'],prefix="/students")
|
2026-09-20 19:45:36 +08:00
|
|
|
#-------------张义---------------
|
2026-09-22 10:47:28 +08:00
|
|
|
app.include_router(teacher_router,tags=['教师接口'],prefix="/teachers")
|
|
|
|
|
app.include_router(class_teacher_router,tags=['教师班级关系接口'],prefix="/class_teacher")
|
2026-09-20 19:45:36 +08:00
|
|
|
#-------------薄鑫---------------
|
2026-09-22 10:02:24 +08:00
|
|
|
from api import consultant
|
|
|
|
|
app.include_router(consultant.router)
|
2026-09-20 17:06:24 +08:00
|
|
|
#-------------张昕浩---------------
|
|
|
|
|
app.include_router(example_router)
|
2026-09-22 15:10:09 +08:00
|
|
|
app.include_router(magic_router)
|
2026-09-21 14:34:43 +08:00
|
|
|
app.include_router(statistics_router, prefix="/statistics")
|
2026-09-20 17:06:24 +08:00
|
|
|
|
2026-09-20 19:45:36 +08:00
|
|
|
#-------------曾凯---------------
|
2026-09-22 10:02:24 +08:00
|
|
|
from api.score import scores_router
|
|
|
|
|
app.include_router(scores_router, tags=['成绩接口'])
|
2026-09-20 19:45:36 +08:00
|
|
|
#-------------南方宇---------------
|
2026-09-22 11:16:45 +08:00
|
|
|
from api.employment import employment_router
|
|
|
|
|
app.include_router(employment_router, prefix="/employment")
|
2026-09-20 17:06:24 +08:00
|
|
|
#-----------主程序----------------
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2026-09-22 15:10:09 +08:00
|
|
|
uvicorn.run(app, host="0.0.0.0", port=23333)
|