package com.changfa.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.util.List;

@Data
public class PageBuilder<T> {

    private  List<T> records;
    private long current;
    private long size;
    private long total;

    public  PageBuilder builder(Page page){
        this.current = page.getCurrent();
        this.size = page.getSize();
        this.records = page.getRecords();
        this.total = page.getTotal();
        return this;
    }
}
