package com.ywt.mg.params;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Min;

/**
 * PageRequest Class
 *
 * @author daiyihua
 * @date 2019/11/15
 */
@ApiModel(value = "分页请求参数")
public class PageRequest {

    @ApiModelProperty(value = "当前页数")
    private int pageIndex;

    @ApiModelProperty(value = "每页大小")
    private int pageSize;

    public int getPageIndex() {
        return pageIndex < 1 ? 1 : pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize < 1 ? 10 : pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
