|
@@ -36,20 +36,20 @@ public class Result implements Serializable {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public Result(Integer code, String msg, Object data) {
|
|
|
+ public Result(Integer code, String error, Object message) {
|
|
|
this.code = code;
|
|
|
- this.error = msg;
|
|
|
- this.message = data;
|
|
|
+ this.error = error;
|
|
|
+ this.message = message;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处理成功,并返回数据
|
|
|
*
|
|
|
- * @param data 数据对象
|
|
|
+ * @param message 数据对象
|
|
|
* @return data
|
|
|
*/
|
|
|
- public static Result success(Object data) {
|
|
|
- return new Result(CODE_SUCCESS, SUCCESS_MSG, data);
|
|
|
+ public static Result success(Object message) {
|
|
|
+ return new Result(CODE_SUCCESS, SUCCESS_MSG, message);
|
|
|
}
|
|
|
/**
|
|
|
* 处理成功
|
|
@@ -62,34 +62,34 @@ public class Result implements Serializable {
|
|
|
/**
|
|
|
* 处理成功
|
|
|
*
|
|
|
- * @param msg 消息
|
|
|
- * @param data 数据对象
|
|
|
+ * @param error 消息
|
|
|
+ * @param message 数据对象
|
|
|
* @return data
|
|
|
*/
|
|
|
- public static Result success(String msg, Object data) {
|
|
|
- return new Result(CODE_SUCCESS, msg, data);
|
|
|
+ public static Result success(String error, Object message) {
|
|
|
+ return new Result(CODE_SUCCESS, error, message);
|
|
|
}
|
|
|
/**
|
|
|
* 处理失败,并返回数据(一般为错误信息)
|
|
|
*
|
|
|
* @param code 错误代码
|
|
|
- * @param msg 消息
|
|
|
+ * @param error 消息
|
|
|
* @return data
|
|
|
*/
|
|
|
- public static Result failure(Integer code, String msg) {
|
|
|
- return new Result(code, msg, NOOP);
|
|
|
+ public static Result failure(Integer code, String error) {
|
|
|
+ return new Result(code, error, NOOP);
|
|
|
}
|
|
|
- public static Result failure(Integer code, String msg,Object data) {
|
|
|
- return new Result(code, msg, data);
|
|
|
+ public static Result failure(Integer code, String error,Object message) {
|
|
|
+ return new Result(code, error, message);
|
|
|
}
|
|
|
/**
|
|
|
* 处理失败
|
|
|
*
|
|
|
- * @param msg 消息
|
|
|
+ * @param error 消息
|
|
|
* @return data
|
|
|
*/
|
|
|
- public static Result failure(String msg) {
|
|
|
- return failure(CODE_FAILURE, msg);
|
|
|
+ public static Result failure(String error) {
|
|
|
+ return failure(CODE_FAILURE, error);
|
|
|
}
|
|
|
|
|
|
@Override
|