【7.6.0】【sys】简化用户信息的包装

pull/55/MERGE
fengshuonan 2023-06-11 17:05:36 +08:00
parent 14fd6e2960
commit a2d1723244
4 changed files with 61 additions and 168 deletions

View File

@ -24,7 +24,7 @@
*/
package cn.stylefeng.roses.kernel.sys.api;
import cn.stylefeng.roses.kernel.sys.api.pojo.SysUserDTO;
import cn.stylefeng.roses.kernel.sys.api.pojo.SimpleUserDTO;
/**
* Api
@ -41,6 +41,6 @@ public interface SysUserServiceApi {
* @author majianguo
* @since 2021/1/9 19:00
*/
SysUserDTO getUserInfoByUserId(Long userId);
SimpleUserDTO getUserInfoByUserId(Long userId);
}

View File

@ -0,0 +1,57 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.sys.api.pojo;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import lombok.Data;
/**
*
*
* @author fengshuonan
* @since 2023/6/11 17:05
*/
@Data
public class SimpleUserDTO {
/**
*
*/
@ChineseDescription("主键")
private Long userId;
/**
*
*/
@ChineseDescription("姓名")
private String realName;
/**
*
*/
@ChineseDescription("头像地址")
private String avatarUrl;
}

View File

@ -1,164 +0,0 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.sys.api.pojo;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
*
*
* @author fengshuonan
* @since 2020/4/2 9:19
*/
@Data
public class SysUserDTO {
/**
*
*/
@ChineseDescription("主键")
private Long userId;
/**
*
*/
@ChineseDescription("账号")
private String account;
/**
*
*/
@ChineseDescription("昵称")
private String nickName;
/**
*
*/
@ChineseDescription("姓名")
private String realName;
/**
*
*/
@ChineseDescription("头像")
private Long avatar;
/**
*
*/
@ChineseDescription("生日")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
/**
* M-F-
*/
@ChineseDescription("性别M-男F-女)")
private String sex;
/**
*
*/
@ChineseDescription("邮箱")
private String email;
/**
*
*/
@ChineseDescription("手机")
private String phone;
/**
*
*/
@ChineseDescription("密码")
private String password;
/**
*
*/
@ChineseDescription("电话")
private String tel;
/**
*
*/
@ChineseDescription("用户所属机构")
private Long orgId;
/**
*
*/
@ChineseDescription("用户所属机构名称")
private String orgName;
/**
*
*/
@ChineseDescription("用户所属机构的职务")
private Long positionId;
/**
*
*/
@ChineseDescription("职务名称")
private String positionName;
/**
*
*/
@ChineseDescription("状态")
private Integer statusFlag;
/**
* id
*/
@ChineseDescription("用户角色id")
private List<Long> grantRoleIdList;
/**
* Y-N-
*/
@ChineseDescription("是否是超级管理员超级管理员可以拥有所有权限Y-是N-否)")
private String superAdminFlag;
/**
* 5
*/
@ChineseDescription("是否密码重试次数过多")
private Boolean loginErrorCountFlag = false;
/**
*
*/
@ChineseDescription("头像地址")
private String avatarUrl;
}

View File

@ -3,7 +3,7 @@ package cn.stylefeng.roses.kernel.sys.modular.org.factory;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.stylefeng.roses.kernel.sys.api.SysUserServiceApi;
import cn.stylefeng.roses.kernel.sys.api.pojo.SysUserDTO;
import cn.stylefeng.roses.kernel.sys.api.pojo.SimpleUserDTO;
import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrgApprover;
import cn.stylefeng.roses.kernel.sys.modular.org.pojo.response.ApproverBindUserItem;
@ -41,7 +41,7 @@ public class OrgApproverFactory {
// 获取用户详情信息
SysUserServiceApi sysUserServiceApi = SpringUtil.getBean(SysUserServiceApi.class);
SysUserDTO sysUserDTO = sysUserServiceApi.getUserInfoByUserId(userId);
SimpleUserDTO sysUserDTO = sysUserServiceApi.getUserInfoByUserId(userId);
bindUserItem.setName(sysUserDTO.getRealName());
bindUserItem.setAvatarUrl(sysUserDTO.getAvatarUrl());