package cn.qg.qaplatform.utils.page;

import com.github.pagehelper.PageInfo;

public class PageUtil {

    /**
     * 设置接口分页返回的结果
     * @param pageList
     * @param pageNum
     * @param pageSize
     * @return
     */
    public static PageResult getPageResult(PageInfo<?> pageList, Integer pageNum, Integer pageSize) {
        PageResult pageResult = new PageResult();
        pageResult.setPageNum(pageNum);
        pageResult.setPageSize(pageSize);
        pageResult.setTotalPage(pageList.getPages());
        pageResult.setTotalNum(pageList.getTotal());
        pageResult.setContent(pageList.getList());
        return pageResult;
    }
}
