package cn.com.qmth.examcloud.tool.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@Setter
@Getter
public class PageInfo<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<T> list;

    private int limit;//每页条数

    private int index;//当前第几页

    private long total;//总条数

    private long size;//当前页的数量

    private long pages;//总页数

    public boolean hasNext(int pageNo, int pageSize) {
        int totalPages = (int) Math.ceil((double) this.total / (double) pageSize);
        return pageNo + 1 < totalPages;
    }

}
