wangmengmeng
2024-12-24 24432a361d5c6bd6f3d8c008693e9f1155d62517
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.dji.sdk.cloudapi.device;
 
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
 
import java.util.Arrays;
 
/**
 * @author sean
 * @version 1.7
 * @date 2023/5/26
 */
@Schema(description = "device type", enumAsRef = true)
public enum DeviceTypeEnum {
 
    M350(89),
 
    M300(60),
 
    M30_OR_M3T_CAMERA(67),
 
    M3E(77),
 
    Z30(20),
 
    XT2(26),
 
    FPV(39),
 
    XTS(41),
 
    H20(42),
 
    H20T(43),
 
    P1(50),
 
    M30_CAMERA(52),
 
    M30T_CAMERA(53),
 
    H20N(61),
 
    DOCK_CAMERA(165),
 
    L1(90742),
 
    M3E_CAMERA(66),
 
    M3M_CAMERA(68),
 
    RC(56),
 
    RC_PLUS(119),
 
    RC_PRO(144),
 
    DOCK(1),
 
    DOCK2(2),
 
    M3D(91),
 
    M3D_CAMERA(80),
 
    M3TD_CAMERA(81),
    ;
 
    private final int type;
 
    DeviceTypeEnum(int type) {
        this.type = type;
    }
 
    @JsonValue
    public int getType() {
        return type;
    }
 
    @JsonCreator
    public static DeviceTypeEnum find(int type) {
        return Arrays.stream(values()).filter(typeEnum -> typeEnum.type == type).findAny()
                .orElseThrow(() -> new CloudSDKException(DeviceTypeEnum.class, type));
    }
}