【8.0】【system】用户信息接口返回账号

pull/57/head
fengshuonan 2023-07-12 14:00:03 +08:00
parent 7b62b050cb
commit c705036e32
2 changed files with 8 additions and 1 deletions

View File

@ -42,6 +42,12 @@ public class SimpleUserDTO {
@ChineseDescription("主键") @ChineseDescription("主键")
private Long userId; private Long userId;
/**
*
*/
@ChineseDescription("账号")
private String account;
/** /**
* *
*/ */

View File

@ -324,7 +324,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysUserLambdaQueryWrapper.eq(SysUser::getUserId, userId); sysUserLambdaQueryWrapper.eq(SysUser::getUserId, userId);
sysUserLambdaQueryWrapper.select(SysUser::getRealName, SysUser::getAvatar); sysUserLambdaQueryWrapper.select(SysUser::getRealName, SysUser::getAvatar, SysUser::getAccount);
SysUser sysUser = this.getOne(sysUserLambdaQueryWrapper); SysUser sysUser = this.getOne(sysUserLambdaQueryWrapper);
if (sysUser == null) { if (sysUser == null) {
return null; return null;
@ -333,6 +333,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
SimpleUserDTO simpleUserDTO = new SimpleUserDTO(); SimpleUserDTO simpleUserDTO = new SimpleUserDTO();
simpleUserDTO.setUserId(userId); simpleUserDTO.setUserId(userId);
simpleUserDTO.setRealName(sysUser.getRealName()); simpleUserDTO.setRealName(sysUser.getRealName());
simpleUserDTO.setAccount(sysUser.getAccount());
// 获取头像文件id信息转化为头像URL // 获取头像文件id信息转化为头像URL
Long avatarFileId = sysUser.getAvatar(); Long avatarFileId = sysUser.getAvatar();