package com.zcxk.charge.api.dto.watepump;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @ClassName WaterPumpStateDto
 * @Description: 泵站状态记录
 * @Author lihui
 * @Date 2021/4/21
 * @Version V1.0
 **/
@Data
public class WaterPumpStateDto {


    @ApiModelProperty("设备状态标识")
    private Integer state;

    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date beginTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date endTime;

    public Date getEndTime(){
        return endTime == null ? new Date() : endTime;
    }
}
