package com.ld.igds.data;
|
|
import java.util.Collections;
|
import java.util.List;
|
|
/**
|
* 根据需要重写封装系统使用的Page对象,主要是为了满足LayUI前端的使用
|
*
|
* @author Andy
|
*/
|
public class Page<T> extends com.baomidou.mybatisplus.plugins.Page<T> {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
private List<T> data = Collections.emptyList();// LAYUI中使用的数据信息
|
|
private String code = "0";// LAYUI 中的定义
|
|
private String msg;// LAYUI使用的提示信息
|
|
private int count;// LAYUI使用的总数
|
|
private int limit = 10;// 每页显示的条数。laypage将会借助 count 和 limit 计算出分页数
|
|
private int curr;// 起始页。一般用于刷新类型的跳页以及HASH跳页
|
|
public int getLimit() {
|
limit = super.getSize();
|
return limit;
|
}
|
|
public void setLimit(int limit) {
|
this.limit = limit;
|
this.setSize(limit);
|
}
|
|
public int getCurr() {
|
curr = super.getCurrent();
|
return curr;
|
}
|
|
public void setCurr(int curr) {
|
this.curr = curr;
|
super.setCurrent(curr);
|
}
|
|
public List<T> getData() {
|
data = super.getRecords();
|
return data;
|
}
|
|
public void setData(List<T> data) {
|
this.data = data;
|
super.setRecords(data);
|
}
|
|
public String getCode() {
|
return code;
|
}
|
|
public void setCode(String code) {
|
this.code = code;
|
}
|
|
public String getMsg() {
|
return msg;
|
}
|
|
public void setMsg(String msg) {
|
this.msg = msg;
|
}
|
|
public int getCount() {
|
count = (int) super.getTotal();
|
return count;
|
}
|
|
public void setCount(int count) {
|
this.count = count;
|
super.setTotal(count);
|
}
|
|
|
public Page() {
|
}
|
|
public Page(int current, int size) {
|
super(current, size);
|
}
|
|
public Page(int current, int size, String orderByField) {
|
super(current, size);
|
this.setOrderByField(orderByField);
|
}
|
|
public Page(int current, int size, String orderByField, boolean isAsc) {
|
this(current, size, orderByField);
|
this.setAsc(isAsc);
|
}
|
|
}
|