package com.ssj.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ssj.framework.basic.common.bean.Page;

/**
 * @author yrf
 * @description
 * @time 2019/8/29 17:22
 */
public class MybatisPlusUtil {

    private MybatisPlusUtil() {
    }

    public static <T> Page<T> parsePage(IPage<T> page) {
        Page<T> resultPage = new Page<>();
        resultPage.setPageNo(page.getCurrent());
        resultPage.setPageSize(page.getSize());
        resultPage.setRowCnt(page.getTotal());
        resultPage.setPages(page.getPages());
        resultPage.setList(page.getRecords());
        return resultPage;
    }

}
