v1.1更新家长端可查看历史记录
This commit is contained in:
@@ -63,4 +63,48 @@ async def get_child_attendance(request: Request):
|
||||
|
||||
result = await ParentService.get_child_attendance(user["user_id"])
|
||||
|
||||
return success_response(data=result)
|
||||
|
||||
|
||||
@router.get("/child/ranking")
|
||||
async def get_child_ranking(request: Request):
|
||||
"""
|
||||
获取子女排名信息
|
||||
"""
|
||||
user = await get_current_user(request)
|
||||
|
||||
if user["user_type"] != "parent":
|
||||
return error_response(message="仅限家长访问", code=403)
|
||||
|
||||
result = await ParentService.get_child_ranking(user["user_id"])
|
||||
|
||||
if "error" in result:
|
||||
return error_response(message=result["error"], code=400)
|
||||
|
||||
return success_response(data=result)
|
||||
|
||||
|
||||
@router.get("/child/history")
|
||||
async def get_child_history(
|
||||
request: Request,
|
||||
page: int = Query(1, ge=1),
|
||||
page_size: int = Query(20, ge=1, le=100)
|
||||
):
|
||||
"""
|
||||
获取子女操行分历史记录
|
||||
"""
|
||||
user = await get_current_user(request)
|
||||
|
||||
if user["user_type"] != "parent":
|
||||
return error_response(message="仅限家长访问", code=403)
|
||||
|
||||
result = await ParentService.get_child_history(
|
||||
parent_id=user["user_id"],
|
||||
page=page,
|
||||
page_size=page_size
|
||||
)
|
||||
|
||||
if "error" in result:
|
||||
return error_response(message=result["error"], code=400)
|
||||
|
||||
return success_response(data=result)
|
||||
Reference in New Issue
Block a user