package com.zcxk.charge.web.common;


import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author  andy
 */
@Data
public class Pagination<T> implements Serializable {

    private static final long serialVersionUID = -4899829840696212229L;

    @ApiModelProperty("总记录数")
    private long total;

    @ApiModelProperty("结果集")
    private List<T> list;

    public Pagination(){

    }

    /**
    * 包装Page对象
    * @author Andy
    * @date 9:56 2021/8/13
    * @param page:
    * @return
    **/
    public Pagination(IPage<T> page) {
        this.list = page.getRecords();
        this.total = page.getTotal();
    }
}
