作者 yangfu

用户详情 返回roleType

@@ -372,6 +372,12 @@ func (userService *UserService) GetUser(getUserQuery *query.GetUserQuery) (inter @@ -372,6 +372,12 @@ func (userService *UserService) GetUser(getUserQuery *query.GetUserQuery) (inter
372 if userBase != nil { 372 if userBase != nil {
373 user.UserInfo = userBase.UserInfo 373 user.UserInfo = userBase.UserInfo
374 } 374 }
  375 + // TODO:后期可以移除有冗余roleType
  376 + for i := range user.UserRole {
  377 + if _, role, _ := factory.FastPgRole(transactionContext, user.UserRole[i].RoleId); role != nil {
  378 + user.UserRole[i].RoleType = role.RoleType
  379 + }
  380 + }
375 userDto := &dto.UserDto{Im: userBase.Im} 381 userDto := &dto.UserDto{Im: userBase.Im}
376 if err := userDto.LoadDto(user, company); err != nil { 382 if err := userDto.LoadDto(user, company); err != nil {
377 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 383 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -127,6 +127,7 @@ func (role *Role) CloneSample() *Role { @@ -127,6 +127,7 @@ func (role *Role) CloneSample() *Role {
127 RoleId: role.RoleId, 127 RoleId: role.RoleId,
128 RoleName: role.RoleName, 128 RoleName: role.RoleName,
129 Ext: role.Ext, 129 Ext: role.Ext,
  130 + RoleType: role.RoleType,
130 } 131 }
131 } 132 }
132 133