1
This commit is contained in:
@@ -6,7 +6,7 @@ from util.database import get_db
|
||||
|
||||
StudentAPI = APIRouter()
|
||||
|
||||
@StudentAPI.get('/students',response_model=list[StudentPageResponse],tags=['学⽣基本信息管理模块'],summary='学生信息查询接口',description='查询学生信息')
|
||||
@StudentAPI.get('/students',response_model=StudentPageResponse,tags=['学⽣基本信息管理模块'],summary='学生信息查询接口',description='查询学生信息')
|
||||
def get_students(stu_id:int|None=None
|
||||
,stu_name:str|None=None
|
||||
,class_id:int|None=None
|
||||
@@ -22,12 +22,10 @@ def get_students(stu_id:int|None=None
|
||||
|
||||
if not r:
|
||||
raise HTTPException(status_code=404,detail='学生不存在')
|
||||
return {'code': 200
|
||||
, 'detail': 'ok'
|
||||
, 'page': page
|
||||
, 'page_size': page_size
|
||||
, 'total': total
|
||||
, 'data': r}
|
||||
return StudentPageResponse(page=page,
|
||||
page_size=page_size,
|
||||
total=total,
|
||||
data=r)
|
||||
|
||||
@StudentAPI.put('/{stu_id}',tags=['学⽣基本信息管理模块'],summary='学生信息更新接口',description='更新学生信息')
|
||||
def update_students(s:StudentRequest
|
||||
|
||||
Reference in New Issue
Block a user