package com.sunda.spmswms.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BaseQueryDTO {

    /**
     * 分页查询的参数，当前页数
     */
    @ApiModelProperty(value = "当前页数")
    private Integer current = 1;
    /**
     * 分页查询的参数，当前页面每页显示的数量
     */
    @ApiModelProperty(value = "当前页面每页显示的数量")
    private Integer size = 20;

    /**
     * 从form中获取page参数，用于分页查询参数
     *
     * @return
     */
    public Page getPage() {
        return new Page(this.getCurrent(), this.getSize());
    }
}
