Merge remote-tracking branch 'base-version/test' into dev
This commit is contained in:
@@ -59,9 +59,12 @@ public class UserRespVO{
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "用户来源,参见 UserSourceEnum 枚举类", example = "1")
|
||||
@ExcelProperty("用户来源")
|
||||
private Integer userSource;
|
||||
|
||||
@Schema(description = "用户来源标签", example = "外部用户")
|
||||
@ExcelProperty("用户来源")
|
||||
private String userSourceLabel;
|
||||
|
||||
@Schema(description = "用户头像", example = "123456789")
|
||||
private String avatar;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zt.plat.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.zt.plat.module.system.dal.dataobject.dept.PostDO;
|
||||
import com.zt.plat.module.system.dal.dataobject.permission.RoleDO;
|
||||
import com.zt.plat.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.zt.plat.module.system.enums.user.UserSourceEnum;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@@ -32,6 +33,10 @@ public interface UserConvert {
|
||||
default UserRespVO convert(AdminUserDO user) {
|
||||
UserRespVO vo = BeanUtils.toBean(user, UserRespVO.class);
|
||||
vo.setAvatar(user.getAvatar());
|
||||
if (user.getUserSource() != null) {
|
||||
UserSourceEnum sourceEnum = UserSourceEnum.of(user.getUserSource());
|
||||
vo.setUserSourceLabel(sourceEnum != null ? sourceEnum.getName() : null);
|
||||
}
|
||||
if (user.getDeptIds() != null) {
|
||||
vo.setDeptIds(CollectionUtils.convertList(user.getDeptIds(), Long::longValue));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user