package com.dora.dto;

import lombok.Data;
import java.util.List;

/**
 * 分页结果DTO
 */
@Data
public class PageResultDto<T> {
    
    /**
     * 总记录数
     */
    private Long total;
    
    /**
     * 总页数
     */
    private Long pages;
    
    /**
     * 当前页码
     */
    private Long current;
    
    /**
     * 每页大小
     */
    private Long size;
    
    /**
     * 数据列表
     */
    private List<T> records;
    
    /**
     * 分类（可选）
     */
    private String category;
    
    /**
     * 构造函数
     */
    public PageResultDto(Long total, Long current, Long size, List<T> records) {
        this.total = total;
        this.current = current;
        this.size = size;
        this.records = records;
        this.pages = (total + size - 1) / size;
    }
    
    /**
     * 构造函数（带分类）
     */
    public PageResultDto(Long total, Long current, Long size, List<T> records, String category) {
        this(total, current, size, records);
        this.category = category;
    }
} 