package com.yida.data.common.core.common;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class BaseDTO<T> {

    @ApiModelProperty("当前页码，默认为1")
    private Integer pageNum = 1;

    @ApiModelProperty("页面大小，默认为10")
    private Integer pageSize = 10;

    public Page<T> toPage() {
        return new Page<>(this.pageNum, this.pageSize);
    }
}
