package com.jkcredit.invoice.hub.model.vo.user;

import com.baomidou.mybatisplus.core.toolkit.EnumUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.jkcredit.invoice.hub.enums.UserStatusEnum;
import com.jkcredit.invoice.hub.enums.UserTypeEnum;
import com.jkcredit.invoice.hub.util.CommonUtil;
import com.jkcredit.invoice.hub.util.EnumStatusUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;

/**
 * @description:
 * @author: xusonglin
 * @create: 2020/1/7 22:25
 * @version: V1.0
 **/
@Data
public class UserVO implements Serializable {

    private static final long serialVersionUID = -5086205443686309467L;

    private Long id;
    private String username;
    private String appKey;
    private String company;

    private Integer userType;
    private Integer status;
    private String contactName;
    private String telephone;
    private Double price;
    private String roleName;
    private Double balance;

    public String getStatusDisplay() {
        if (this.status == null) {
            return StringUtils.EMPTY;
        }
        return EnumStatusUtils.getStatusByValue(UserStatusEnum.class, this.status).getDesc();
    }

    public String getUserTypeDisplay() {
        if (this.userType == null) {
            return StringUtils.EMPTY;
        }
        return EnumStatusUtils.getStatusByValue(UserTypeEnum.class, this.userType).getDesc();
    }
}
