liusuyi
2025-11-20 ee357f0dd7bee415a5eca5ba95f70eaeeb1aadcd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.ard.work.domain.message;
 
import lombok.Getter;
 
/**
 * 控制权类型枚举
 *
 * @author liusuyi
 * @date 2024年11月04日14:40
 **/
@Getter
public enum UavControlType {
    FLY("fly"), PAYLOAD("payload");
 
    private final String type;
 
    UavControlType(String type) {
        this.type = type;
    }
 
    public static UavControlType fromString(String type) {
        for (UavControlType value : UavControlType.values()) {
            if (value.getType().equalsIgnoreCase(type)) {
                return value;
            }
        }
        throw new IllegalArgumentException("未知的控制类型: " + type);
    }
}