package com.sckw.payment.model.vo.res;

import com.sckw.core.model.page.PageRes;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 返回的分页数据中，有额外需要返回的参数
 *
 * @author Aick Spt
 * @date 2023-07-25 17:31
 */
@Getter
@Setter
public class MorePageRes<T> extends PageRes<T> {
    private String money;

    public MorePageRes(int page, int pageSize, long size, int pages, List<T> list, String money) {
        super(page, pageSize, size, pages, list);
        this.money = money;
    }

    public MorePageRes(int page, int pageSize, List<T> list, String money) {
        this.page = page;
        this.pageSize = pageSize;
        this.size = list.size();
        this.pages = list.size() / pageSize + 1;
        this.money = money;
        this.list = list.stream().skip((long) (page - 1) * pageSize).limit(pageSize).toList();
    }

}
