package com.yuchen.saas.park.api.dto.park;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nest.springwrap.core.mp.support.Query;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
public class WarningDetailListQueryDTO extends Query {
    @NotNull(message = "园区id不能为空")
    private Long parkId;

    @ApiModelProperty("告警类型编号")
    private String identity;

    @ApiModelProperty("风险等级")
    private Integer level;

    @ApiModelProperty("处理状态  1：未处理，2：处理中，3：已处理，4：已忽略")
    private Integer status;

    @ApiModelProperty("告警开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @ApiModelProperty("告警结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    public Long getStartTime() {
        return startTime==null?null:startTime.getTime();
    }

    public Long getEndTime() {
        return endTime==null?null:endTime.getTime();
    }
}
