【fix sonar】Result文件
This commit is contained in:
+6
-6
@@ -54,7 +54,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> OK() {
|
public static<T> Result<T> OK() {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setSuccess(true);
|
r.setSuccess(true);
|
||||||
r.setCode(CommonConstant.SC_OK_200);
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
r.setMessage("成功");
|
r.setMessage("成功");
|
||||||
@@ -62,7 +62,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> OK(String message) {
|
public static<T> Result<T> OK(String message) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setSuccess(true);
|
r.setSuccess(true);
|
||||||
r.setCode(CommonConstant.SC_OK_200);
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
r.setMessage(message);
|
r.setMessage(message);
|
||||||
@@ -70,7 +70,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> OK(T data) {
|
public static<T> Result<T> OK(T data) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setSuccess(true);
|
r.setSuccess(true);
|
||||||
r.setCode(CommonConstant.SC_OK_200);
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
r.setResult(data);
|
r.setResult(data);
|
||||||
@@ -78,7 +78,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> OK(String msg, T data) {
|
public static<T> Result<T> OK(String msg, T data) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setSuccess(true);
|
r.setSuccess(true);
|
||||||
r.setCode(CommonConstant.SC_OK_200);
|
r.setCode(CommonConstant.SC_OK_200);
|
||||||
r.setMessage(msg);
|
r.setMessage(msg);
|
||||||
@@ -87,7 +87,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> error(String msg, T data) {
|
public static<T> Result<T> error(String msg, T data) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setSuccess(false);
|
r.setSuccess(false);
|
||||||
r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||||
r.setMessage(msg);
|
r.setMessage(msg);
|
||||||
@@ -100,7 +100,7 @@ public class Result<T> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static<T> Result<T> error(int code, String msg) {
|
public static<T> Result<T> error(int code, String msg) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<>();
|
||||||
r.setCode(code);
|
r.setCode(code);
|
||||||
r.setMessage(msg);
|
r.setMessage(msg);
|
||||||
r.setSuccess(false);
|
r.setSuccess(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user