com.github.xiaoyuge5201.request.PageResult Maven / Gradle / Ivy
package com.github.xiaoyuge5201.request;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author yugb
* @desc 分页基类
*/
public class PageResult {
private Integer code = 0;
private String msg = "";
/**
* 结果集
*/
private List data;
/**
* 每页显示条数
*/
private int pageSize;
/**
* 页码
*/
private int pageNo;
/**
* 总量
*/
private Long count;
/**
* 查询参数
*/
private Map params = new HashMap<>();
/**
* 排序方式
*/
private Map orders = new HashMap<>();
public PageResult() {
}
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 int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getOffset() {
return (pageNo - 1) * pageSize;
}
public List getData() {
return data;
}
public void setData(List data) {
this.data = data;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public Long getCount() {
return count;
}
public void setCount(Long total) {
this.count = total;
}
public Map getParams() {
return params;
}
public void setParams(Map params) {
this.params = params;
}
public Map getOrders() {
return orders;
}
public void setOrders(Map orders) {
this.orders = orders;
}
}