package com.platform.modules.sys.vo;

import com.platform.modules.sys.entity.SysUserEntity;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Date;
import java.util.List;

/**
 * @author MXY
 * 2020/5/8 13:52
 */
@Data
public class SysUserInfoVo {

    private Long userId;

    private String username;

    private String realname;

    private String userImg;

    private String idCard;

    private String email;

    private String mobile;

    private Integer status;

    private Long tenantId;

    private String tenantName;

    private List<Long> roleIdList;

    private Date createTime;
    
    private String salt;


    public SysUserInfoVo (SysUserEntity source){
        userId = source.getUserId();
        username = source.getUsername();
        realname = StringUtils.isNotBlank(source.getRealname()) ? source.getRealname() : null;
        userImg = StringUtils.isNotBlank(source.getUserImg()) ? source.getUserImg() : null;
        idCard = StringUtils.isNotBlank(source.getIdCard()) ? source.getIdCard() : null;
        email = StringUtils.isNotBlank(source.getEmail()) ? source.getEmail() : null;
        mobile = StringUtils.isNotBlank(source.getMobile()) ? source.getMobile() : null;
        status = source.getStatus();
        tenantId = source.getTenantId();
        tenantName = StringUtils.isNotBlank(source.getTenantName()) ? source.getTenantName() : null;
        roleIdList = source.getRoleIdList();
        createTime = source.getCreateTime();
        salt = StringUtils.isNotBlank(source.getSalt()) ? source.getSalt() : null;
    }
}
