package com.ard.sample.manage.model.enums; import lombok.Getter; /** * 【机场1】机场机型代际枚举(Dock1 适配共享层新增)。 * *

判据为 device_model_key(三段 {@code domain-type-sub_type},落库逻辑见 * DeviceServiceImpl.bindDevice2Entity)中的 type 段: * 机场设备(domain=3)Dock1=1 / Dock2=2;飞行器(domain=0)M30 系列=67 / M3D 系列=91。 * * @author ard * @date 2026/10/16 */ @Getter public enum DockModelEnum { /** 机场1(DJI Dock 1):飞行器为 M30/M30T(type=67,sub_type 0=M30 / 1=M30T) */ DOCK1(1, 67), /** 机场2(DJI Dock 2):飞行器为 M3D/M3TD(type=91,sub_type 0=M3D / 1=M3TD) */ DOCK2(2, 91); /** 机场设备(domain=3)的 device type */ private final int dockType; /** 飞行器(domain=0)的 device type */ private final int droneType; DockModelEnum(int dockType, int droneType) { this.dockType = dockType; this.droneType = droneType; } /** * 按机场设备的 device type 解析机型。 * * @param type 机场设备 type(dock1=1 / dock2=2) * @return 对应机型;未知返回 null */ public static DockModelEnum fromDockType(int type) { for (DockModelEnum model : values()) { if (model.dockType == type) { return model; } } return null; } /** * 按飞行器的 device type 解析机型。 * * @param type 飞行器 type(M30 系列=67 / M3D 系列=91) * @return 对应机型;未知返回 null */ public static DockModelEnum fromDroneType(int type) { for (DockModelEnum model : values()) { if (model.droneType == type) { return model; } } return null; } }