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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package com.vci.common.log;
 
 
/**
 * 日志类型
 * 
 * @author Administrator
 * 
 */
public enum LogType {
    /**
     * 登录
     */
    Login("Login", "登录", 1),
    /**
     * 登出
     */
    Logout("Logout", "登出", 2),
    /**
     * 授权
     */
    GrantPrivileges("GrantPrivileges", "授权", 3),
    /**
     * 一般操作
     */
    GeneralOperation("GeneralOperation", "一般操作", 4),
    /**
     * 集成操作
     */
    Integration("Integration", "集成操作", 5),
    
    /**
     * 锁定用户
     */
    LockUser("LockUser", "锁定用户", 6),
    
    /**
     * 解锁用户
     */
    UnlockUser("UnlockUser", "解锁用户", 7),
 
    /**
     * 卷文件上传
     */
    VolumnFileUpload("VolumnFileUpload", "卷文件上传", 8),
    /**
     * 卷文件下载
     */
    VolumnFileDownload("VolumnFileDownload", "卷文件下载", 9);
    
    private String name = "";
    private String label = "";
    private int intVal = 1;
    
    private LogType(String name, String label, int intVal){
        this.name = name;
        this.label = label;
        this.intVal = intVal;
    }
    
    public static LogType[] getAll() {
        return values();
    }
 
    public static LogType getByName(String name) {
        LogType res = getByType(LogByType.Name, name);
        return res;
    }
 
    public static LogType getByLabel(String label) {
        LogType res = getByType(LogByType.Label, label);
        return res;
    }
 
    public static LogType getByIntVal(int intVal) {
        LogType res = getByType(LogByType.IntVal, String.valueOf(intVal));
        return res;
    }
 
    public static LogType getByType(LogByType type, String val) {
        LogType[] alls = getAll();
        LogType res = null;
        for (LogType obj : alls) {
            if ((type == LogByType.Name)
                    && (obj.getName().equalsIgnoreCase(val))) {
                res = obj;
                break;
            }
            if ((type == LogByType.Label)
                    && (obj.getLabel().equalsIgnoreCase(val))) {
                res = obj;
                break;
            }
            if ((type == LogByType.IntVal)
                    && (String.valueOf(obj.getIntVal()).equalsIgnoreCase(val))) {
                res = obj;
                break;
            }
        }
        return res;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getLabel() {
        return label;
    }
 
    public void setLabel(String label) {
        this.label = label;
    }
 
    public int getIntVal() {
        return intVal;
    }
 
    public void setIntVal(int intVal) {
        this.intVal = intVal;
    }
 
}