update 优化 R 默认返回 msg
parent
7726fa9773
commit
4ed3aa1a88
|
|
@ -39,11 +39,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) {
|
||||||
|
|
@ -55,7 +55,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) {
|
||||||
|
|
@ -63,7 +63,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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue