lxw
2023-12-21 21a2275b893d210e8777d2a8239bbf994b95b40e
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
package com.whyc.constant;
/*
* 日志操作类型*/
public enum LogOpEnum {
    //控制类型
    TYPE_CMD_RED(0,"读取参数"),
    TYPE_CMD_UPDATE(1,"设置参数"),
    TYPE_CMD_START(2,"启动放电"),
    TYPE_CMD_STOP(3,"停止放电"),
    ;
 
    private Integer type;
    private String name;
 
    LogOpEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }
 
    public Integer getType() {
        return type;
    }
 
    public String getName() {
        return name;
    }
 
    public static String getValueByKey(int key) {
        for (LogOpEnum logOpEnum : LogOpEnum.values()) {
            if (logOpEnum.getType().equals(key)) {
                return logOpEnum.getName();
            }
        }
        return null;
    }
 
}