package com.platform.modules.sys.vo;

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

/**
 * @author MXY
 * 2020/5/8 11:38
 */
@Data
public class SysUserEntityVo {

    private Long userId;

    private String username;

    private String realname;

    private String userImg;

    private String idCard;

    private Long tenantId;

    public SysUserEntityVo (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;
        tenantId = source.getTenantId();
    }
}
