1. 程式人生 > 實用技巧 >layui 分頁 java後端封裝

layui 分頁 java後端封裝

/**
 * LayUI Table 分頁物件
*/
public class PaginationDto<T> {

    /**介面狀態*/
    private Integer code;
    /**提示文字*/
    private String msg;
    /**資料長度*/
    private Long count;
    /**資料列表*/
    private List<T> data;
    @JsonIgnore
    private final int SUCCESS_CODE = 0;
    public PaginationDto() {
        
super(); } public PaginationDto(Long count, List<T> data) { super(); this.code = SUCCESS_CODE; this.count = count; this.data = data; } public PaginationDto(Integer code, String msg, Long count, List<T> data) { super(); this.code = code;
this.msg = msg; this.count = count; this.data = data; } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) {
this.msg = msg; } public Long getCount() { return count; } public void setCount(Long count) { this.count = count; } public List<T> getData() { return data; } public void setData(List<T> data) { this.data = data; } }