All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zcj.web.dto.sep.req.PageVo Maven / Gradle / Ivy

There is a newer version: 1.1.38
Show newest version
package com.zcj.web.dto.sep.req;

import com.zcj.util.validator.annotation.Validator;
import com.zcj.web.context.SystemContext;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

public class PageVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "页码", example = "1", required = true)
    @Validator(required = true, minValue = "0", maxValue = "1000000")
    private Integer pageNo = 1;

    @ApiModelProperty(value = "每页几条", example = "20", required = true)
    @Validator(required = true, minValue = "1")
    private Integer pageSize = 20;

    @ApiModelProperty(value = "忽略分页参数(不分页查询)", example = "true")
    private Boolean ignorePage = false;

    // 存储分页信息供上下文使用
    public void savePageInfo() {
        if (Boolean.TRUE.equals(ignorePage)) {
            SystemContext.setPagesize(Integer.MAX_VALUE);
            SystemContext.setOffset(0);
        } else {
            SystemContext.setPagesize(pageSize);
            SystemContext.setOffset((pageNo - 1) * pageSize);
        }
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Boolean getIgnorePage() {
        return ignorePage;
    }

    public void setIgnorePage(Boolean ignorePage) {
        this.ignorePage = ignorePage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy