Pu Zhibing
2025-03-10 922de4e688e18f508070972876002fa6a3810135
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
package com.stylefeng.guns.modular.system.model.enums;
 
/**
 * 图片模型枚举类
 * @author zhibing.pu
 * @Date 2024/12/17 20:50
 */
public enum ImageModelEnum {
    TOP_SEAL("顶盖密闭巡查", "TOP_SEAL"),
    CAMERA_FAULT("摄像头故障巡查", "CAMERA_FAULT"),
    CONSTRUCTION_WASTE_LOAD("建筑垃圾装载巡查", "CONSTRUCTION_WASTE_LOAD")
    ;
    
    /**
     * 模型名称
     */
    private String name;
    /**
     * 模型编号
     */
    private String code;
    
    ImageModelEnum(String name, String code) {
        this.name = name;
        this.code = code;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    
    /**
     * 根据编号获取枚举对象
     * @param code
     * @return
     */
    public static ImageModelEnum getImageModelEnum(String code){
        ImageModelEnum[] values = ImageModelEnum.values();
        for (ImageModelEnum modelEnum : values) {
            if(modelEnum.getCode().equals(code)){
                return modelEnum;
            }
        }
        return null;
    }
}