|
|
@@ -28,6 +28,13 @@ public class R<T> implements Serializable {
|
|
|
@Schema(description = "返回状态")
|
|
|
private Boolean status;
|
|
|
|
|
|
+ @Setter
|
|
|
+ @Schema(description = "状态码")
|
|
|
+ private Integer code=200;
|
|
|
+ public Integer getCode() {
|
|
|
+ return status?200:500;
|
|
|
+ }
|
|
|
+
|
|
|
@Getter
|
|
|
@Setter
|
|
|
@Schema(description = "返回数据")
|
|
|
@@ -50,7 +57,8 @@ public class R<T> implements Serializable {
|
|
|
}
|
|
|
|
|
|
public static <T> R<T> failed(String msg) {
|
|
|
- return restResult(null, false, msg);
|
|
|
+ R<T> result= restResult(null, false, msg);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public static <T> R<T> failed(T data) {
|