|
@@ -20,8 +20,8 @@ public enum ServiceErrorCode implements ErrorCode {
|
|
|
USER_EXIST("10020008", "该账号已注册"),
|
|
|
EMAIL_IS_NULL("10020009", "请输入邮箱");
|
|
|
|
|
|
- private String code;
|
|
|
- private String msg;
|
|
|
+ private final String code;
|
|
|
+ private final String msg;
|
|
|
|
|
|
|
|
|
ServiceErrorCode(String code, String msg) {
|
|
@@ -40,7 +40,7 @@ public enum ServiceErrorCode implements ErrorCode {
|
|
|
|
|
|
public static ServiceErrorCode codeOf(String code) {
|
|
|
for (ServiceErrorCode state : values()) {
|
|
|
- if (state.getCode() == code) {
|
|
|
+ if (state.getCode().equals(code)) {
|
|
|
return state;
|
|
|
}
|
|
|
}
|