update 优化 R 默认返回 msg

This commit is contained in:
疯狂的狮子li 2022-02-22 14:03:53 +08:00
parent 075f7fc19e
commit 3517a8f494

View File

@ -38,11 +38,11 @@ public class R<T> implements Serializable {
private T data; private T data;
public static <T> R<T> ok() { public static <T> R<T> ok() {
return restResult(null, SUCCESS, null); return restResult(null, SUCCESS, "操作成功");
} }
public static <T> R<T> ok(T data) { public static <T> R<T> ok(T data) {
return restResult(data, SUCCESS, null); return restResult(data, SUCCESS, "操作成功");
} }
public static <T> R<T> ok(String msg) { public static <T> R<T> ok(String msg) {
@ -54,7 +54,7 @@ public class R<T> implements Serializable {
} }
public static <T> R<T> fail() { public static <T> R<T> fail() {
return restResult(null, FAIL, null); return restResult(null, FAIL, "操作失败");
} }
public static <T> R<T> fail(String msg) { public static <T> R<T> fail(String msg) {
@ -62,7 +62,7 @@ public class R<T> implements Serializable {
} }
public static <T> R<T> fail(T data) { public static <T> R<T> fail(T data) {
return restResult(data, FAIL, null); return restResult(data, FAIL, "操作失败");
} }
public static <T> R<T> fail(String msg, T data) { public static <T> R<T> fail(String msg, T data) {