完成了添加学生接口的自动生成studentno功能

This commit is contained in:
wolin_liyujie
2026-09-21 19:28:15 +08:00
parent 8b0cdbdb10
commit 30e6af308d
4 changed files with 31 additions and 14 deletions
+3 -1
View File
@@ -4,7 +4,7 @@ from schemas.student import StudentCreate
from sqlalchemy.orm import Session
student_router = APIRouter()
@student_router.post("")
@student_router.post("",summary='添加学生')
def create_student(request:StudentCreate,db:Session = Depends(get_db)):
d = request.model_dump()
r = create_students(d,db)
@@ -12,3 +12,5 @@ def create_student(request:StudentCreate,db:Session = Depends(get_db)):
raise HTTPException(status_code=500,detail='服务器繁忙,请稍后添加!')
return {'code':200,'detail':"添加学生成功"}