package com.multictrl.modules.business.dto.remote.debug;

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

import java.util.List;

/**
 * 一键标定参数
 *
 * @author Sdy
 * @since 1.0.0 2026/5/20
 */
@Data
@Schema(name = "一键标定参数")
public class RtkCalibration {

    @Valid
    @NotEmpty(message = "标定设备不能为空")
    @Schema(description = "标定设备集合")
    private List<CalibrationDevice> devices;

    @Data
    @Schema(name = "标定设备")
    public static class CalibrationDevice {
        @NotBlank(message = "设备序列号不能为空")
        @Schema(description = "设备序列号（SN）", example = "ABC123456789")
        private String sn;

        @Schema(description = "标定类型 {1: 手动标定}", example = "1", allowableValues = {"1"})
        private Integer type = 1;

        @NotBlank(message = "模块类型不能为空")
        @Schema(description = "模块枚举值 {3:机场,6:中继}", example = "3", allowableValues = {"3", "6"})
        private String module;

        @Valid
        @NotNull(message = "标定数据不能为空")
        @Schema(description = "标定数据")
        private CalibrationData data;
    }

    @Data
    @Schema(name = "标定数据")
    public static class CalibrationData {
        @NotNull(message = "经度不能为空")
        @Schema(description = "经度", example = "114.89828051067889")
        private Double longitude;

        @NotNull(message = "纬度不能为空")
        @Schema(description = "纬度", example = "22.755022128112614")
        private Double latitude;

        @NotNull(message = "高度不能为空")
        @Schema(description = "高度", example = "60.285194396972656")
        private Double height;
    }
}
