【7.6.0】【sys】更新个人信息接口,增加对头像的图片返回

pull/57/head
fengshuonan 2023-06-28 10:11:15 +08:00
parent 207e6515f4
commit d06c92086c
2 changed files with 12 additions and 4 deletions

View File

@ -1,8 +1,10 @@
package cn.stylefeng.roses.kernel.sys.modular.user.entity;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseExpandFieldEntity;
import cn.stylefeng.roses.kernel.file.api.format.FileUrlFormatProcess;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.EnumFieldFormat;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import cn.stylefeng.roses.kernel.rule.enums.SexEnum;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import cn.stylefeng.roses.kernel.sys.api.enums.user.UserStatusEnum;
@ -76,6 +78,7 @@ public class SysUser extends BaseExpandFieldEntity {
*/
@TableField("avatar")
@ChineseDescription("头像存的为文件id")
@SimpleFieldFormat(processClass = FileUrlFormatProcess.class)
private Long avatar;
/**

View File

@ -130,7 +130,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public SysUser detail(SysUserRequest sysUserRequest) {
SysUser sysUser = this.querySysUser(sysUserRequest);
// 查询用户个人信息
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysUserLambdaQueryWrapper.eq(SysUser::getUserId, sysUserRequest.getUserId());
sysUserLambdaQueryWrapper.select(SysUser::getUserId, SysUser::getAvatar, SysUser::getSuperAdminFlag, SysUser::getRealName,
SysUser::getSex, SysUser::getBirthday, SysUser::getEmail, SysUser::getPhone, SysUser::getLastLoginIp,
SysUser::getLoginCount, SysUser::getLastLoginTime, SysUser::getStatusFlag, BaseEntity::getCreateTime,
BaseEntity::getUpdateTime);
SysUser sysUser = this.getOne(sysUserLambdaQueryWrapper, false);
// 获取用户的组织机构信息
List<UserOrgDTO> userOrgList = sysUserOrgService.getUserOrgList(sysUser.getUserId());
@ -140,9 +148,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List<Long> userRoleIdList = sysUserRoleService.getUserRoleIdList(sysUser.getUserId());
sysUser.setRoleIdList(userRoleIdList);
// 屏蔽不需要的字段
sysUser.setPassword(null);
return sysUser;
}