lyh
8 小时以前 371365543363969fd3afcc404440c838817ecc3d
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
package com.lxzn.framework.domain.base.response;
 
import com.google.common.collect.ImmutableMap;
import com.lxzn.framework.model.response.ResultCode;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;
 
@ToString
public enum DictionaryCode implements ResultCode {
    DIC_TYPE_CODE_NONE(false,24001,"请输入字典类型码!"),
    DIC_NAME_NONE(false,24002,"请输入字典名称!"),
    DIC_VALUE_NONE(false,24003,"请输入字典值!"),
    DIC_CODE_EXiST(false, 24004, "字典已存在!"),
    DIC_NOT_EXIST(false, 24005, "字典不存在!");
 
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
 
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    private DictionaryCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    private static final ImmutableMap<Integer, DictionaryCode> CACHE;
 
    static {
        final ImmutableMap.Builder<Integer, DictionaryCode> builder = ImmutableMap.builder();
        for (DictionaryCode commonCode : values()) {
            builder.put(commonCode.code(), commonCode);
        }
        CACHE = builder.build();
    }
 
    @Override
    public boolean success() {
        return success;
    }
 
    @Override
    public int code() {
        return code;
    }
 
    @Override
    public String message() {
        return message;
    }
}