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),
|
|
DELETE_FACE_FAIL("删除表单失败", 3),
|
GET_FACE_COLUMN_FAIL("获取列表配置失败", 4),
|
GET_FACE_CONFIG_FAIL("获取表单配置信息失败", 5),
|
|
REQUEST_PARAM_ERROR("请求参数有误", 6),
|
|
GET_FACE_CONF_FAIL("获取表单配置失败", 7),
|
|
;
|
|
|
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);
|
}
|
}
|