package cn.superdesk.uniorder.common.pagination;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import java.util.List;

/**
 * @author linjinyu
 * @description
 * @date 2018年4月2日
 */
public class PageResult<T> {

	// 状态
	private int    code = 200;
	// 返回信息
	@JsonInclude(Include.NON_NULL)
	private String msg;

	private int     pageNo;
	private int     pageSize;
	private long    count;
	// 响应数据
	@JsonInclude(Include.NON_NULL)
	private List<T> data;

	public PageResult() {
	}

	public PageResult(int code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}

	public PageResult(int pageNo, int pageSize, long count, List<T> data) {
		super();
		this.pageNo = pageNo;
		this.pageSize = pageSize;
		this.count = count;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int 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 getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	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;
	}


}
