package com.example.demo.model.dto;

import com.example.demo.model.enums.EventSourceType;
import com.example.demo.model.enums.ThreatLevel;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.time.LocalDateTime;

/**
 * 事件查询/接收参数DTO。
 * <p>
 * 用于接收上游传感器的事件数据或前端查询参数。
 * </p>
 */
@Schema(description = "事件接收/查询参数")
public class EventQueryDTO {

    @Schema(description = "事件来源类型")
    private EventSourceType sourceType;

    @Schema(description = "事件发生时间")
    private LocalDateTime occurTime;

    @Schema(description = "目标经纬度，JSON格式")
    private String location;

    @Schema(description = "事件置信度（0.0~1.0）")
    @Min(0) @Max(1)
    private double confidence;

    @Schema(description = "威胁等级")
    private ThreatLevel threatLevel;

    @Schema(description = "事件类型")
    private String eventType;

    @Schema(description = "处理状态关键字过滤")
    private String statusFilter;

    @Schema(description = "排序字段（createTime / occurTime / threatLevel / confidence）")
    private String sortField;

    @Schema(description = "排序方向：asc / desc")
    private String sortDirection;

    @Schema(description = "页码，从0开始")
    private int page;

    @Schema(description = "每页条数")
    private int size;

    public EventSourceType getSourceType() {
        return sourceType;
    }

    public void setSourceType(EventSourceType sourceType) {
        this.sourceType = sourceType;
    }

    public LocalDateTime getOccurTime() {
        return occurTime;
    }

    public void setOccurTime(LocalDateTime occurTime) {
        this.occurTime = occurTime;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public double getConfidence() {
        return confidence;
    }

    public void setConfidence(double confidence) {
        this.confidence = confidence;
    }

    public ThreatLevel getThreatLevel() {
        return threatLevel;
    }

    public void setThreatLevel(ThreatLevel threatLevel) {
        this.threatLevel = threatLevel;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public String getStatusFilter() {
        return statusFilter;
    }

    public void setStatusFilter(String statusFilter) {
        this.statusFilter = statusFilter;
    }

    public String getSortField() {
        return sortField;
    }

    public void setSortField(String sortField) {
        this.sortField = sortField;
    }

    public String getSortDirection() {
        return sortDirection;
    }

    public void setSortDirection(String sortDirection) {
        this.sortDirection = sortDirection;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }
}
