7
7
from backend .app .admin .schema .user import (
8
8
AddUserParam ,
9
9
AvatarParam ,
10
- GetCurrentUserInfoDetail ,
11
- GetUserInfoDetail ,
10
+ GetCurrentUserInfoWithRelationDetail ,
11
+ GetUserInfoWithRelationDetail ,
12
12
RegisterUserParam ,
13
13
ResetPasswordParam ,
14
14
UpdateUserParam ,
@@ -32,7 +32,7 @@ async def register_user(obj: RegisterUserParam) -> ResponseModel:
32
32
33
33
34
34
@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 ]:
36
36
await user_service .add (request = request , obj = obj )
37
37
data = await user_service .get_userinfo (username = obj .username )
38
38
return response_base .success (data = data )
@@ -47,13 +47,13 @@ async def password_reset(request: Request, obj: ResetPasswordParam) -> ResponseM
47
47
48
48
49
49
@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 ()
52
52
return response_base .success (data = data )
53
53
54
54
55
55
@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 ]:
57
57
data = await user_service .get_userinfo (username = username )
58
58
return response_base .success (data = data )
59
59
@@ -103,7 +103,7 @@ async def get_pagination_users(
103
103
username : Annotated [str | None , Query ()] = None ,
104
104
phone : Annotated [str | None , Query ()] = None ,
105
105
status : Annotated [int | None , Query ()] = None ,
106
- ) -> ResponseSchemaModel [PageData [GetUserInfoDetail ]]:
106
+ ) -> ResponseSchemaModel [PageData [GetUserInfoWithRelationDetail ]]:
107
107
user_select = await user_service .get_select (dept = dept , username = username , phone = phone , status = status )
108
108
page_data = await paging_data (db , user_select )
109
109
return response_base .success (data = page_data )
0 commit comments