package cn.autoform.bean.page;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import com.github.pagehelper.Page;
|
|
import lombok.Data;
|
|
/**
|
* 分页返回值
|
* @author WangYX
|
*
|
* @param <T>
|
*/
|
@Data
|
public class PageResult<T> {
|
|
public PageResult() {
|
super();
|
}
|
|
public PageResult(Page<T> page){
|
if(page == null){
|
this.list = new ArrayList<>();
|
this.count = 0L;
|
return;
|
}
|
this.list = page.getResult();
|
this.count = page.getTotal();
|
}
|
|
/**
|
* 数据集合
|
*/
|
private List<T> list;
|
|
/**
|
* 小民民要的code
|
*/
|
private List<T> code;
|
|
/**
|
* 数据总条数
|
*/
|
private Long count;
|
|
}
|