package com.aiup.service.domain.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class ListBaseResponse<T> {
    @ApiModelProperty(value = "总记录条数")
    Integer total;
    @ApiModelProperty(value = "当前页码")
    Integer currentIndex;
    @ApiModelProperty(value = "每页条数")
    Integer pageSize;
    @ApiModelProperty(value = "数据列表")
    List<T> list;
    public ListBaseResponse<T> ofList(List<T> list,Integer total,Integer currentIndex,Integer pageSize){
        this.setCurrentIndex(currentIndex);
        this.setPageSize(pageSize);
        this.setTotal(total);
        this.setList(list);
        return this;
    }
}
