统一返回格式

hehai
shijie 4 years ago
parent 044c5b65c4
commit b94fb43240
  1. 12
      src/main/java/com/msdw/tms/entity/response/ResponseResult.java

@ -24,7 +24,7 @@ public class ResponseResult<T> {
/** /**
* 状态码 * 状态码
*/ */
private int code; private int status;
/** /**
* 返回的数据 * 返回的数据
@ -36,15 +36,15 @@ public class ResponseResult<T> {
*/ */
private String message; private String message;
public ResponseResult(boolean success, int code, String message) { public ResponseResult(boolean success, int status, String message) {
this.success = success; this.success = success;
this.code = code; this.status = status;
this.message = message; this.message = message;
} }
public ResponseResult(ResultCode resultCode) { public ResponseResult(ResultCode resultCode) {
this.success = resultCode.success(); this.success = resultCode.success();
this.code = resultCode.code(); this.status = resultCode.code();
this.message = resultCode.message(); this.message = resultCode.message();
} }
@ -68,8 +68,8 @@ public class ResponseResult<T> {
return new ResponseResult(CommonCode.FAIL); return new ResponseResult(CommonCode.FAIL);
} }
public static ResponseResult FAIL(int code, String message) { public static ResponseResult FAIL(int status, String message) {
return new ResponseResult<>(false, code, null, message); return new ResponseResult<>(false, status, null, message);
} }
} }

Loading…
Cancel
Save