refactor: 个人中心个人信息完善
This commit is contained in:
@@ -43,7 +43,7 @@ public interface UserConverter {
|
||||
SysUser toEntity(UserImportDTO vo);
|
||||
|
||||
|
||||
UserProfileVO toProfileVO(SysUser entity);
|
||||
UserProfileVO toProfileVO(UserBO bo);
|
||||
|
||||
SysUser toEntity(UserProfileForm formData);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user