lyh
2025-01-13 137d008bd9b7d932160436a3a560b24512f6d1db
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
package org.jeecg.modules.dnc.response;
 
import com.google.common.collect.ImmutableMap;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;
 
@ToString
public enum DeviceGroupCode implements ResultCode {
    DEVICE_GROUP_NAME(false,25501,"请输入分组名称!"),
    DEVICE_GROUP_EXIST(false, 25502, "分组已存在!"),
    DEVICE_GROUP_PARENT_NOT_EXIST(false, 25503, "指定的父分组不存在!"),
    DEVICE_GROUP_NOT_EXIST(false, 25504, "分组不存在!"),
    DEVICE_GROUP_SAVE_ERROR(false, 25505, "分组保存失败!"),
    DEVICE_GROUP_NOT_PERM(false, 25506, "没有该分组的访问权限!"),
    DEVICE_GROUP_PERM_ERROR(false, 25507, "权限分配失败"),
    DEVICE_GROUP_CHILD_EXIST(false, 25508, "存在子分组"),
    DEVICE_GROUP_DEVICE_EXIST(false, 25509, "分组有关联的设备信息"),
    DEVICE_GROUP_USER_NONE(false, 25510, "分组无法清空用户权限,请至少保留一位可操作用户!");
 
    //操作代码
    @ApiModelProperty(value = "操作是否成功", example = "true", required = true)
    boolean success;
 
    //操作代码
    @ApiModelProperty(value = "操作代码", example = "22001", required = true)
    int code;
    //提示信息
    @ApiModelProperty(value = "操作提示", example = "操作过于频繁!", required = true)
    String message;
    private DeviceGroupCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    private static final ImmutableMap<Integer, DeviceGroupCode> CACHE;
 
    static {
        final ImmutableMap.Builder<Integer, DeviceGroupCode> builder = ImmutableMap.builder();
        for (DeviceGroupCode 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;
    }
}