package com.multictrl.modules.business.dto;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.multictrl.common.validator.group.DefaultGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.util.Objects;

/**
 * 导入航线参数
 *
 * @author Sdy
 * @since 1.0.0 2026/6/18
 */
@Data
@Schema(name = "导入航线参数")
public class UploadRouteDTO {

    @NotBlank(message = "机库SN不能为空")
//    @Schema(description = "机库SN")
    private String dockSn;

    @NotNull(message = "是否精准导入不能为空")
//    @Schema(description = "是否精准导入 true false")
    private Boolean accurateImport;

    //    @Schema(description = "返航高度")
    private Double globalRthHeight;

    @NotNull(message = "航线文件不能为空")
//    @Schema(description = "航线文件")
    private MultipartFile file;

    @JsonIgnore
    @Schema(hidden = true)
    @AssertTrue(message = "返航高度不能为空")
    public boolean isGlobalRthHeightValid() {
        if (accurateImport) {
            return globalRthHeight != null;
        }
        return true;
    }
}
