77from backend .app .admin .schema .user import (
88 AddUserParam ,
99 AvatarParam ,
10- GetCurrentUserInfoDetail ,
11- GetUserInfoDetail ,
10+ GetCurrentUserInfoWithRelationDetail ,
11+ GetUserInfoWithRelationDetail ,
1212 RegisterUserParam ,
1313 ResetPasswordParam ,
1414 UpdateUserParam ,
@@ -32,7 +32,7 @@ async def register_user(obj: RegisterUserParam) -> ResponseModel:
3232
3333
3434@router .post ('/add' , summary = '添加用户' , dependencies = [DependsRBAC ])
35- async def add_user (request : Request , obj : AddUserParam ) -> ResponseSchemaModel [GetUserInfoDetail ]:
35+ async def add_user (request : Request , obj : AddUserParam ) -> ResponseSchemaModel [GetUserInfoWithRelationDetail ]:
3636 await user_service .add (request = request , obj = obj )
3737 data = await user_service .get_userinfo (username = obj .username )
3838 return response_base .success (data = data )
@@ -47,13 +47,13 @@ async def password_reset(request: Request, obj: ResetPasswordParam) -> ResponseM
4747
4848
4949@router .get ('/me' , summary = '获取当前用户信息' , dependencies = [DependsJwtAuth ], response_model_exclude = {'password' })
50- async def get_current_user (request : Request ) -> ResponseSchemaModel [GetCurrentUserInfoDetail ]:
51- data = GetCurrentUserInfoDetail ( ** request .user .model_dump () )
50+ async def get_current_user (request : Request ) -> ResponseSchemaModel [GetCurrentUserInfoWithRelationDetail ]:
51+ data = request .user .model_dump ()
5252 return response_base .success (data = data )
5353
5454
5555@router .get ('/{username}' , summary = '查看用户信息' , dependencies = [DependsJwtAuth ])
56- async def get_user (username : Annotated [str , Path (...)]) -> ResponseSchemaModel [GetUserInfoDetail ]:
56+ async def get_user (username : Annotated [str , Path (...)]) -> ResponseSchemaModel [GetUserInfoWithRelationDetail ]:
5757 data = await user_service .get_userinfo (username = username )
5858 return response_base .success (data = data )
5959
@@ -103,7 +103,7 @@ async def get_pagination_users(
103103 username : Annotated [str | None , Query ()] = None ,
104104 phone : Annotated [str | None , Query ()] = None ,
105105 status : Annotated [int | None , Query ()] = None ,
106- ) -> ResponseSchemaModel [PageData [GetUserInfoDetail ]]:
106+ ) -> ResponseSchemaModel [PageData [GetUserInfoWithRelationDetail ]]:
107107 user_select = await user_service .get_select (dept = dept , username = username , phone = phone , status = status )
108108 page_data = await paging_data (db , user_select )
109109 return response_base .success (data = page_data )
0 commit comments