package org.springblade.modules.api.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

@Data
@ApiModel(value = "时间范围请求对象", description = "请求实体类")
public class TimeRangeReq {

    @ApiModelProperty(value = "门店id")
    private Integer shopId;

    @ApiModelProperty(value = "设备id")
    private Integer facility;

    @ApiModelProperty(value = "查询时间类型，1今天，2昨天，3本月，4上月，5今年，6自定义", required = true)
    @NotNull(message = "查询时间类型不能为空")
    private Integer dateType;

    @ApiModelProperty(value = "自定义-开始时间-年月日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    @ApiModelProperty(value = "自定义-结束时间-年月日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

}
