干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2023-03-10 58d42ccf875b120f40fddce63752298e916e0b0b
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
package org.jeecg.common.constant.enums;
 
import org.jeecg.common.constant.CommonConstant;
 
/**
 * @Description: 操作类型
 * @author: jeecg-boot
 * @date: 2022/3/31 10:05
 */
public enum OperateTypeEnum {
 
    /**
     * 列表
     */
    LIST(CommonConstant.OPERATE_TYPE_1, "list"),
 
    /**
     * 新增
     */
    ADD(CommonConstant.OPERATE_TYPE_2, "add"),
 
    /**
     * 编辑
     */
    EDIT(CommonConstant.OPERATE_TYPE_3, "edit"),
 
    /**
     * 删除
     */
    DELETE(CommonConstant.OPERATE_TYPE_4, "delete"),
 
    /**
     * 导入
     */
    IMPORT(CommonConstant.OPERATE_TYPE_5, "import"),
 
    /**
     * 导出
     */
    EXPORT(CommonConstant.OPERATE_TYPE_6, "export");
 
    /**
     * 类型 1列表,2新增,3编辑,4删除,5导入,6导出
     */
    int type;
 
    /**
     * 编码(请求方式)
     */
    String code;
 
 
    public int getType() {
        return type;
    }
 
    public void setType(int type) {
        this.type = type;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    /**
     * 构造器
     *
     * @param type 类型
     * @param code 编码(请求方式)
     */
    OperateTypeEnum(int type, String code) {
        this.type = type;
        this.code = code;
    }
 
 
    /**
     * 根据请求名称匹配
     *
     * @param methodName 请求名称
     * @return Integer 类型
     */
    public static Integer getTypeByMethodName(String methodName) {
        for (OperateTypeEnum e : OperateTypeEnum.values()) {
            if (methodName.startsWith(e.getCode())) {
                return e.getType();
            }
        }
        return CommonConstant.OPERATE_TYPE_1;
    }
}