
package cn.ysk.cashier.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

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

@Data
public class ShopUserInfoVo implements Serializable {
    private Integer id;
    private Integer userId;
    private String headImg;
    private String nickName;
    private Object sex;
    private BigDecimal amount;

    private Integer totalScore;
    private String telephone;
    private String birthDay;
    private Integer isVip;
    private long createAt;
    private long lastLoginAt;

    private BigDecimal inMoney;
    private Integer orderNumber;

    /**
     * 账户积分
     */
    private Integer accountPoints;
    /**
     * 最近一次积分变动时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastPointsChangeTime;
    /**
     * 最近一次浮动积分
     */
    private Integer lastFloatPoints;

    public Object getSex() {
        return sex;
    }

    public void setSex(Object sex) {
        if (sex == null) {
            this.sex="未知";
        }else if(sex.equals(1)){
            this.sex = "男";
        }else if(sex.equals(0)){
            this.sex = "女";
        }
    }

    // 无参构造函数
    public ShopUserInfoVo() {
    }

//    private ShopUserInfoVo(Integer id, String headImg, String nickName, Object sex, BigDecimal amount, Integer totalScore, String telephone, String birthDay, Integer isVip, long createAt, long lastLoginAt) {
//        this.id = id;
//        this.headImg = headImg;
//        this.nickName = nickName;
//        setSex(sex);
//        this.amount = amount;
//        this.totalScore = totalScore;
//        this.telephone = telephone;
//        this.birthDay = birthDay;
//        this.isVip = isVip;
//        this.createAt = createAt;
//        this.lastLoginAt = lastLoginAt;
//    }
}