package com.bonus.canteen.core.user.domain;

import com.bonus.common.core.utils.DateUtils;
import groovy.transform.ToString;
import io.swagger.annotations.ApiModelProperty;

import java.time.Instant;
public class DeviceMqPersonalUpdateMessageDTO {
    @ApiModelProperty("是否更新人员")
    private Integer updatePerson;
    @ApiModelProperty("是否更新特征值")
    private Integer updatePersonPhoto;
    @ApiModelProperty("是否更新卡信息 1是更新")
    private Integer updateCardStatus;
    @ApiModelProperty("是否有账户余额变动")
    private Integer isAccBalChange;
    @ApiModelProperty("消息生成时间")
    private Long time;
    @ApiModelProperty("是否更新有效期照片1更新")
    private Integer updateValidityPhoto;
    @ApiModelProperty("当前时间")
    private String currentTime;
    @ApiModelProperty("类型")
    private String type;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setCurrentTime(String currentTime) {
        this.currentTime = currentTime;
    }

    public String getCurrentTime() {
        return DateUtils.getTime();
    }

    public Long getTime() {
        return Instant.now().toEpochMilli();
    }

    public Integer getUpdatePerson() {
        return this.updatePerson;
    }

    public Integer getUpdatePersonPhoto() {
        return this.updatePersonPhoto;
    }

    public Integer getUpdateCardStatus() {
        return this.updateCardStatus;
    }

    public Integer getIsAccBalChange() {
        return this.isAccBalChange;
    }

    public Integer getUpdateValidityPhoto() {
        return this.updateValidityPhoto;
    }


    public DeviceMqPersonalUpdateMessageDTO setUpdatePerson(final Integer updatePerson, final String type) {
        this.currentTime = DateUtils.getTime();
        this.updatePerson = updatePerson;
        this.type = type;
        return this;
    }

    public DeviceMqPersonalUpdateMessageDTO setUpdatePerson(final Integer updatePerson) {
        this.currentTime = DateUtils.getTime();
        this.updatePerson = updatePerson;
        return this;
    }
    public DeviceMqPersonalUpdateMessageDTO setUpdatePersonPhoto(final Integer updatePersonPhoto) {
        this.currentTime = DateUtils.getTime();
        this.updatePersonPhoto = updatePersonPhoto;

        return this;
    }

    public DeviceMqPersonalUpdateMessageDTO setUpdateCardStatus(final Integer updateCardStatus) {
        this.currentTime = DateUtils.getTime();
        this.updateCardStatus = updateCardStatus;
        return this;
    }

    public DeviceMqPersonalUpdateMessageDTO setIsAccBalChange(final Integer isAccBalChange) {
        this.currentTime = DateUtils.getTime();
        this.isAccBalChange = isAccBalChange;
        return this;
    }

    public DeviceMqPersonalUpdateMessageDTO setTime(final Long time) {
        this.currentTime = DateUtils.getTime();
        this.time = time;
        return this;
    }

    public DeviceMqPersonalUpdateMessageDTO setUpdateValidityPhoto(final Integer updateValidityPhoto) {
        this.currentTime = DateUtils.getTime();
        this.updateValidityPhoto = updateValidityPhoto;
        return this;
    }

    @Override
    public String toString() {
        return "DeviceMqPersonalUpdateMessageDTO{" +
                "updatePerson=" + updatePerson +
                ", type=" + type +
                ", updatePersonPhoto=" + updatePersonPhoto +
                ", updateCardStatus=" + updateCardStatus +
                ", isAccBalChange=" + isAccBalChange +
                ", time=" + time +
                ", updateValidityPhoto=" + updateValidityPhoto +
                ", currentTime='" + currentTime + '\'' +
                '}';
    }
}
