update > for close #40

master
hengming.lhm 7 years ago
parent 82b336310b
commit ade1c18268
  1. 7
      src/main/java/com/company/project/core/Result.java
  2. 6
      src/main/java/com/company/project/core/ResultCode.java

@ -11,7 +11,7 @@ public class Result {
private Object data; private Object data;
public Result setCode(ResultCode resultCode) { public Result setCode(ResultCode resultCode) {
this.code = resultCode.code; this.code = resultCode.code();
return this; return this;
} }
@ -19,11 +19,6 @@ public class Result {
return code; return code;
} }
public Result setCode(int code) {
this.code = code;
return this;
}
public String getMessage() { public String getMessage() {
return message; return message;
} }

@ -10,9 +10,13 @@ public enum ResultCode {
NOT_FOUND(404),//接口不存在 NOT_FOUND(404),//接口不存在
INTERNAL_SERVER_ERROR(500);//服务器内部错误 INTERNAL_SERVER_ERROR(500);//服务器内部错误
public int code; private final int code;
ResultCode(int code) { ResultCode(int code) {
this.code = code; this.code = code;
} }
public int code() {
return code;
}
} }

Loading…
Cancel
Save