package com.purui.prims.common.pojo;

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

@Data
public class PageBaseReq {

    @ApiModelProperty(value = "最大页数")
    private static final Integer MAX_PAGESIZE = 100;

    @ApiModelProperty(value = "当前页数")
    private Integer current = 1;

    @ApiModelProperty(value = "每页数量")
    private Integer pageSize = 10;

    @ApiModelProperty(value = "排序字段")
    private String sort = "desc";

    @ApiModelProperty(value = "排序条件")
    private String orderCondition;

    public Integer getLimitStart() {
        return this.pageSize * (this.current - 1);
    }

    public Integer getLimitSize() {
        return this.pageSize;
    }

}
