com.zcj.web.dto.sep.req.PageVo Maven / Gradle / Ivy
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;
}
}