提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.core.exception.enums; |
|
17 |
|
|
18 |
import cn.stylefeng.roses.kernel.model.exception.AbstractBaseExceptionEnum; |
|
19 |
|
|
20 |
/** |
|
21 |
* @author fengshuonan |
|
22 |
* @Description 所有业务异常的枚举 |
|
23 |
* @date 2016年11月12日 下午5:04:51 |
|
24 |
*/ |
|
25 |
public enum BizExceptionEnum implements AbstractBaseExceptionEnum { |
|
26 |
|
|
27 |
/** |
|
28 |
* 字典 |
|
29 |
*/ |
|
30 |
DICT_EXISTED(400, "字典已经存在"), |
|
31 |
ERROR_CREATE_DICT(500, "创建字典失败"), |
|
32 |
ERROR_WRAPPER_FIELD(500, "包装字典属性失败"), |
|
33 |
ERROR_CODE_EMPTY(500, "字典类型不能为空"), |
|
34 |
|
|
35 |
/** |
|
36 |
* 文件上传 |
|
37 |
*/ |
|
38 |
FILE_READING_ERROR(400, "FILE_READING_ERROR!"), |
|
39 |
FILE_NOT_FOUND(400, "FILE_NOT_FOUND!"), |
|
40 |
UPLOAD_ERROR(500, "上传图片出错"), |
|
41 |
|
|
42 |
/** |
|
43 |
* 权限和数据问题 |
|
44 |
*/ |
|
45 |
DB_RESOURCE_NULL(400, "数据库中没有该资源"), |
|
46 |
NO_PERMITION(405, "权限异常"), |
|
47 |
REQUEST_INVALIDATE(400, "请求数据格式不正确"), |
|
48 |
INVALID_KAPTCHA(400, "验证码不正确"), |
|
49 |
CANT_DELETE_ADMIN(600, "不能删除超级管理员"), |
|
50 |
CANT_FREEZE_ADMIN(600, "不能冻结超级管理员"), |
|
51 |
CANT_CHANGE_ADMIN(600, "不能修改超级管理员角色"), |
|
52 |
|
|
53 |
/** |
|
54 |
* 账户问题 |
|
55 |
*/ |
|
56 |
NOT_LOGIN(401, "当前用户未登录"), |
|
57 |
USER_ALREADY_REG(401, "该用户已经注册"), |
|
58 |
NO_THIS_USER(400, "没有此用户"), |
|
59 |
USER_NOT_EXISTED(400, "没有此用户"), |
|
60 |
ACCOUNT_FREEZED(401, "账号被冻结"), |
|
61 |
OLD_PWD_NOT_RIGHT(402, "原密码不正确"), |
|
62 |
TWO_PWD_NOT_MATCH(405, "两次输入密码不一致"), |
|
63 |
|
|
64 |
/** |
|
65 |
* 错误的请求 |
|
66 |
*/ |
|
67 |
MENU_PCODE_COINCIDENCE(400, "菜单编号和副编号不能一致"), |
|
68 |
EXISTED_THE_MENU(400, "菜单编号重复,不能添加"), |
|
69 |
DICT_MUST_BE_NUMBER(400, "字典的值必须为数字"), |
|
70 |
REQUEST_NULL(400, "请求有错误"), |
|
71 |
SESSION_TIMEOUT(400, "会话超时"), |
|
72 |
SERVER_ERROR(500, "服务器异常"), |
|
73 |
|
|
74 |
/** |
|
75 |
* token异常 |
|
76 |
*/ |
|
77 |
TOKEN_EXPIRED(700, "token过期"), |
|
78 |
TOKEN_ERROR(700, "token验证失败"), |
|
79 |
|
|
80 |
/** |
|
81 |
* 签名异常 |
|
82 |
*/ |
|
83 |
SIGN_ERROR(700, "签名验证失败"), |
|
84 |
|
|
85 |
/** |
|
86 |
* 系统常量 |
|
87 |
*/ |
|
88 |
ALREADY_CONSTANTS_ERROR(400, "已经存在该编码的系统参数"), |
|
89 |
SYSTEM_CONSTANT_ERROR(400, "不能删除系统常量"), |
|
90 |
|
|
91 |
/** |
|
92 |
* 其他 |
|
93 |
*/ |
|
94 |
AUTH_REQUEST_ERROR(400, "账号密码错误"), |
|
95 |
|
|
96 |
/** |
|
97 |
* ueditor相关异常 |
|
98 |
*/ |
|
99 |
UE_CONFIG_ERROR(800, "读取ueditor配置失败"), |
|
100 |
UE_FILE_NULL_ERROR(801, "上传文件为空"), |
|
101 |
UE_FILE_READ_ERROR(803, "读取文件错误"), |
|
102 |
UE_FILE_SAVE_ERROR(802, "保存ue的上传文件出错"), |
|
103 |
|
|
104 |
/** |
|
105 |
* 工作流相关 |
|
106 |
*/ |
|
107 |
ACT_NO_FLOW(900, "无可用流程,请先导入或新建流程"), |
|
108 |
ACT_ADD_ERROR(901, "新建流程错误"), |
|
109 |
|
|
110 |
/** |
|
111 |
* 租户相关的异常 |
|
112 |
*/ |
|
113 |
NO_TENANT_ERROR(1901, "没有相关租户"); |
|
114 |
|
|
115 |
BizExceptionEnum(int code, String message) { |
|
116 |
this.code = code; |
|
117 |
this.message = message; |
|
118 |
} |
|
119 |
|
|
120 |
private Integer code; |
|
121 |
|
|
122 |
private String message; |
|
123 |
|
|
124 |
@Override |
|
125 |
public Integer getCode() { |
|
126 |
return code; |
|
127 |
} |
|
128 |
|
|
129 |
public void setCode(Integer code) { |
|
130 |
this.code = code; |
|
131 |
} |
|
132 |
|
|
133 |
@Override |
|
134 |
public String getMessage() { |
|
135 |
return message; |
|
136 |
} |
|
137 |
|
|
138 |
public void setMessage(String message) { |
|
139 |
this.message = message; |
|
140 |
} |
|
141 |
} |