package com.nokia.hb.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.nokia.hb.pojo.enums.SearchTypeEnum;
import com.nokia.hb.pojo.enums.TimeTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.util.Set;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class RenderTableDto {
    @Schema(description = "地市列表")
    private Set<String> citys;
    @Schema(description = "区县列表")
    private Set<String> quxians;
    @Schema(description = "时间单位")
    @NotNull(message = "timeType不能为空")
    private TimeTypeEnum timeType;
    @Schema(description = "指标")
    @NotEmpty(message = "indicators不能为空")
    private Set<String> indicators;
    @Schema(description = "起始时间", example = "2022-11-01 13:00:00", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Past(message = "startTime不能大于当前时间")
    @NotNull(message = "startTime不能为空")
    private LocalDateTime startTime;
    @Schema(description = "截至时间", example = "2022-11-02 13:00:00", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @PastOrPresent(message = "endTime不能大于当前时间")
    @NotNull(message = "endTime不能为空")
    private LocalDateTime endTime;
    @Schema(description = "条件")
    private String condition;
    @Schema(description = "搜索类型")
    @NotNull(message = "searchType不能为空")
    private SearchTypeEnum searchType;
}
