Merge pull request 'Li yujie' (#12) from LI_YUJIE into main

Reviewed-on: #12
This commit is contained in:
2026-09-21 14:25:28 +08:00
6 changed files with 96 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
from fastapi import APIRouter,Depends,HTTPException
from sqlalchemy.orm import Session
from dao.student import *
from schemas.student import StudentCreate
student_router = APIRouter()
@student_router.post("/student")
def create_student(request:StudentCreate,db:Session,create = Depends(create_students)):
d = request.model_dump()
r = create_students(d,db)
if not r:
raise HTTPException(status_code=500,detail='服务器繁忙,请稍后添加!')
return {'code':200,'detail':"添加学生成功"}