This commit is contained in:
2023-08-02 16:08:17 +08:00
parent a21078da68
commit b03b36d791

View File

@@ -1,18 +1,24 @@
package cn.lihongjie.coal.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import lombok.Data;
@Data
public class R<T> {
private T data;
private String code ;
private String code;
private String msg;
@JsonInclude(Include.NON_NULL)
private Integer pageNo;
@JsonInclude(Include.NON_NULL)
private Integer pageSize;
@JsonInclude(Include.NON_NULL)
private Integer totalPage;
@JsonInclude(Include.NON_NULL)
private Integer totalCount;
@@ -30,6 +36,7 @@ public class R<T> {
public static <T> R<T> success(T data) {
return create(data, "ok", "");
}
public static <T> R<T> fail(String code, String msg) {
return create(null, code, msg);
}