Merge branch 'develop' of gitee.com:youlaiorg/youlai-boot into develop

This commit is contained in:
ray
2024-08-17 00:02:35 +08:00
5 changed files with 44 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ public interface UserConverter {
SysUser toEntity(UserImportDTO vo);
UserProfileVO toProfileVO(SysUser entity);
UserProfileVO toProfileVO(UserBO bo);
SysUser toEntity(UserProfileForm formData);
}

View File

@@ -56,4 +56,12 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
*/
@DataPermission(deptAlias = "u")
List<UserExportDTO> listExportUsers(UserPageQuery queryParams);
/**
* 获取用户个人中心信息
*
* @param userId 用户ID
* @return
*/
UserBO getUserProfile(Long userId);
}

View File

@@ -1,8 +1,11 @@
package com.youlai.system.model.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
* 个人中心用户信息
*
@@ -34,5 +37,14 @@ public class UserProfileVO {
@Schema(description = "邮箱")
private String email;
@Schema(description = "部门名称")
private String deptName;
@Schema(description = "角色名称")
private String roleNames;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
}

View File

@@ -248,7 +248,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
*/
@Override
public UserProfileVO getUserProfile(Long userId) {
SysUser entity = this.getById(userId);
UserBO entity = this.baseMapper.getUserProfile(userId);
return userConverter.toProfileVO(entity);
}