package org.xyzh.common.core.page;

import java.io.Serializable;
import java.util.List;
/**
 * @description    PageDomain.java文件描述 分页数据实体类
 * @filename    PageDomain.java
 * @author    yslg
 * @copyright xyzh
 * @since 2025-09-07
 */
public class PageDomain<T> implements Serializable{
    private static final long serialVersionUID = 1L;

    /**
     * @description    分页参数
     * @author    yslg
     * @since 2025-09-07
     */
    private PageParam pageParam;

    /**
     * @description    数据列表
     * @author    yslg
     * @since 2025-09-07
     */
    private List<T> dataList;

    public PageDomain() {
    }

    public PageDomain(PageParam pageParam, List<T> dataList) {
        this.pageParam = pageParam;
        this.dataList = dataList;
    }

    public PageDomain(int pageNumber, int pageSize, int totalPages, long totalElements, List<T> dataList) {
        this.pageParam = new PageParam(pageNumber, pageSize, totalPages, totalElements);
        this.dataList = dataList;
    }

    /**
     * @description    设置分页参数
     * @param    pageParam 分页参数
     * @return    void
     * @author    yslg
     * @since 2025-09-07
     */
    public void setPageParam(PageParam pageParam) {
        this.pageParam = pageParam;
    }

    /**
     * @description    获取分页参数
     * @return    PageParam 分页参数
     * @author    yslg
     * @since 2025-09-07
     */
    public PageParam getPageParam() {
        return pageParam;
    }

    /**
     * @description    设置数据列表
     * @param    dataList 数据列表
     * @return    void
     * @author    yslg
     * @since 2025-09-07
     */
    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    /**
     * @description    获取数据列表
     * @return    List<T> 数据列表
     * @author    yslg
     * @since 2025-09-07
     */
    public List<T> getDataList() {
        return dataList;
    }

}
