lxw
2022-08-03 3712fe77699c9aa61c8c92c550c52968ade88a86
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
package com.whyc.constant;
 
import com.fasterxml.jackson.annotation.JsonFormat;
 
/**用户操作类型*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum UserOperation {
    /**操作类型*/
    TYPE_LOGIN(1,"登录系统"),
    TYPE_LOGOUT(2,"登出系统"),
    TYPE_ADD(3,"新增"),
    TYPE_UPDATE(4,"修改"),
    TYPE_DELETE(5,"删除"),
    TYPE_CANCEL(7,"取消"),
    TYPE_STOP(9,"终止"),
    TYPE_GET(10,"读取"),
    TYPE_DOWNLOAD(11,"下载"),
 
    TYPE_UNRECOGNIZED(-1,"无法识别的操作类型"),
    
    TYPE_UNAUTHORIZED_ACCESS(20,"越权访问"),
    TYPE_EXCEPTION(21,"调用异常"),
 
    /**追加的系统级操作类型*/
    TYPE_LOGIN_FAIL(31,"登录失败"),
    TYPE_PARAM_CHANGE(32,"参数变更"),
    TYPE_PASSWORD_CHANGE(33,"密码修改"),
    TYPE_LOGIN_TIMEOUT(34,"登录超时"),
    TYPE_LOGIN_NO_PASS(35,"登录系统-用户ID登录");
 
 
    private Integer type;
    private String typeName;
 
    UserOperation(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }
 
    public Integer getType() {
        return type;
    }
 
    public void setType(Integer type) {
        this.type = type;
    }
 
    public String getTypeName() {
        return typeName;
    }
 
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
 
    public static String getNameByType(Integer type){
        UserOperation[] enums=values();
        for (UserOperation op:enums) {
            if (op.getType()==type){
                return op.getTypeName();
            }
        }
        return "";
    }
}