1821349743@qq.com
2023-04-24 1a83fae321f3f109f077f92ad2931c76df6fe9de
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
package com.product.face.config;
 
import com.product.common.enums.IEnum;
import com.product.common.enums.ModuleEnum;
import com.product.core.exception.BaseException;
 
import java.text.DecimalFormat;
import java.text.Format;
 
/**
 * @Author cheng
 * @Date 2023/4/21 17:41
 * @Desc 表单错误枚举
 */
public enum ErrorCode implements IEnum {
 
    SAVE_FACE_FAIL("保存表单内容失败", 1),
    SAVE_EMPTY_FACE_FAIL("保存表单内容失败,表单内容不能为空", 2),
 
    ;
 
 
    private String text;
    private int value;
 
    ErrorCode(String text, int value) {
        this.value = value;
        this.text = text;
    }
 
    @Override
    public String getText() {
        return this.text;
    }
 
    @Override
    public String getValue() {
        Format f1 = new DecimalFormat("000");
        return ModuleEnum.PRINT.getValue() + f1.format(this.value);
    }
 
    public void throwException() {
        throw new BaseException(this);
    }
}