package com.multictrl.modules.business.dto.command;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.util.List;

/**
 * 飞向目标点参数
 *
 * @author Sdy
 * @since 1.0.0 2026/4/27
 */
@Data
@Schema(name = "飞向目标点请求参数")
public class FlyToPoint {

    @Schema(hidden = true)
    private String flyToId;

    @NotNull(message = "最大速度不能为空")
    @Min(value = 0, message = "最大速度最小值为0米/秒")
    @Max(value = 15, message = "最大速度最大值为15米/秒")
    @Schema(description = "flyto的飞行过程中能达到的最大速度", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    private Integer maxSpeed;

    @Valid
    @NotNull(message = "目标点列表不能为空")
    @Size(min = 1, max = 1, message = "仅支持1个目标点")
    @Schema(description = "flyto目标点列表，仅支持1个目标点", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<Point> points;

    @Data
    @Schema(description = "目标点坐标信息")
    public static class Point {

        @NotNull(message = "目标点纬度不能为空")
        @DecimalMin(value = "-90.0", message = "纬度最小值为-90")
        @DecimalMax(value = "90.0", message = "纬度最大值为90")
        @Schema(description = "目标点纬度，角度值，南纬是负，北纬是正，精度到小数点后6位", requiredMode = Schema.RequiredMode.REQUIRED,
                example = "39.908724")
        private Double latitude;

        @NotNull(message = "目标点经度不能为空")
        @DecimalMin(value = "-180.0", message = "经度最小值为-180")
        @DecimalMax(value = "180.0", message = "经度最大值为180")
        @Schema(description = "目标点经度，角度值，东经是正，西经是负，精度到小数点后6位", requiredMode = Schema.RequiredMode.REQUIRED,
                example = "116.397460")
        private Double longitude;

        @NotNull(message = "目标点高度不能为空")
        @DecimalMin(value = "2.0", message = "目标点高度最小值为2米")
        @DecimalMax(value = "10000.0", message = "目标点高度最大值为10000米")
        @Schema(description = "目标点高度（相对机场高度）", requiredMode = Schema.RequiredMode.REQUIRED,
                example = "100.5")
        private Float height;
    }
}
