![JAR search and dependency download from the Maven repository](/logo.png)
com.github.mengweijin.quickboot.mybatis.Pager Maven / Gradle / Ivy
package com.github.mengweijin.quickboot.mybatis;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.mengweijin.quickboot.domain.AbstractPager;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author mengweijin
* @date 2021/12/26
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class Pager extends AbstractPager {
public Pager toPager(IPage page) {
this.setCurrent(page.getCurrent());
this.setSize(page.getSize());
this.setTotal(page.getTotal());
this.setRecords(page.getRecords());
return this;
}
public IPage toPage() {
return new Page().
setCurrent(this.getCurrent())
.setSize(this.getSize())
.setTotal(this.getTotal())
.setRecords(this.getRecords());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy