package com.pannk.demo.controller;

import lombok.Data;

import java.util.List;

/**
 * Created by wolf on 20-11-9.
 */
@Data
public class Page {
    private int total;
    private int pageSize;
    private int totalPage;
    private int currPage;
    private List<?> list;

    public Page(int pageSize, int currPage) {
        this.pageSize = pageSize;
        this.currPage = currPage;
    }

    public Page(int pageSize, int currPage, List<?> list,int total) {
        this.total = total;
        this.pageSize = pageSize;
        this.totalPage = (int) Math.ceil((double) total / pageSize);
        this.currPage = currPage;
        this.list = list;
    }
}
