- 优化:error 实现 ServiceExceptionUtil.Enumerable

This commit is contained in:
fansili 2020-05-08 10:43:14 +08:00
parent 09eba0d21d
commit 739afb86e3
2 changed files with 34 additions and 5 deletions

View File

@ -0,0 +1,34 @@
package cn.iocoder.mall.user.biz.enums;
import cn.iocoder.common.framework.util.ServiceExceptionUtil;
/**
* 错误码枚举类
*
* 用户系统使用 1-001-000-000
*/
public enum UserErrorCodeEnum implements ServiceExceptionUtil.Enumerable {
// ========== 用户地址 ==========
USER_ADDRESS_NOT_EXISTENT(1001004000, "用户地址不存在!"),
USER_ADDRESS_IS_DELETED(1001004001, "用户地址已被删除!"),
USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"),
;
private final int code;
private final String message;
UserErrorCodeEnum(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@ -1,5 +0,0 @@
/**
* author: sin
* time: 2020/5/3 8:29 下午
*/
package cn.iocoder.mall.user.biz.enums;