package com.ruoyi.interfaces.core.page;

import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.util.List;

/**
 * @author lipujun
 * @date 2018/3/2
 */
@Data
public class Page<T> {
    public int size;
    public long total;
    public int page;
    public int pages;
    public List<T> rows;

    public Page() {
    }

    public Page(int size, long total, int page, int pages, List<T> rows) {
        this.size = size;
        this.total = total;
        this.page = page;
        this.pages = pages;
        this.rows = rows;
    }

    public Page(PageInfo pageInfo) {
        this.size = pageInfo.getSize();
        this.total = pageInfo.getTotal();
        this.page = pageInfo.getPageNum();
        this.pages = pageInfo.getPages();
        this.rows = pageInfo.getList();
    }

}
