尝试合并,所有代码需要调整from后文件路径。
This commit is contained in:
@@ -6,9 +6,9 @@ from students.model.students_model import *
|
||||
from students.schema.students_request import *
|
||||
from students.databases import *
|
||||
|
||||
students_api = APIRouter()
|
||||
s_api = APIRouter()
|
||||
|
||||
@students_api.get("/students"
|
||||
@s_api.get("/students"
|
||||
,summary='学生资料查询'
|
||||
,description=f'筛选条件全为空即查询所有学生资料,输入薪资会查询大于输入薪资以上的学生。\n '
|
||||
f'时间格式:YYYY-MM-DD'
|
||||
@@ -24,7 +24,7 @@ def get_students( stu:StudentsQuery = Depends()
|
||||
raise HTTPException(status_code=404, detail="没有找到符合条件的学生")
|
||||
|
||||
|
||||
@students_api.post("/students"
|
||||
@s_api.post("/students"
|
||||
,summary='新增学生资料'
|
||||
,description=f'学生ID自动分配,学生姓名、学生手机号和班级是必填项,不能为空。\n '
|
||||
f'时间格式:YYYY-MM-DD'
|
||||
@@ -38,7 +38,7 @@ def add_student( stu:StudentsResponse = Depends()
|
||||
raise HTTPException(status_code=500, detail='手机号已有学生使用或必填项为空。')
|
||||
return result
|
||||
|
||||
@students_api.put("/students"
|
||||
@s_api.put("/students"
|
||||
,summary='学生资料更新'
|
||||
,description=f'请输入需要更新信息的学生ID,学生手机号不可重复,填写即更新,为空即不更新。\n '
|
||||
f'时间格式:YYYY-MM-DD'
|
||||
@@ -52,7 +52,7 @@ def get_students( stu:StudentsUpdate = Depends()
|
||||
raise HTTPException(status_code=500, detail='手机号已有学生使用。')
|
||||
return result
|
||||
|
||||
@students_api.delete("/students"
|
||||
@s_api.delete("/students"
|
||||
,summary='删除学生资料'
|
||||
,description=f'输入需要删除的学生信息,删除条件任选,但不可全为空,工资筛选能删除大于等于输入工资的所有人。\n '
|
||||
f'时间格式:YYYY-MM-DD'
|
||||
|
||||
Reference in New Issue
Block a user