123
This commit is contained in:
@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -61,6 +62,19 @@ public class PageQuery implements Serializable {
|
||||
// public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE;
|
||||
public static final int DEFAULT_PAGE_SIZE = 20;
|
||||
|
||||
public boolean checkPageNum(int pageNum){
|
||||
if(this.pageNum != null && this.pageNum > pageNum){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void resetPageSize(){
|
||||
if(this.pageSize != null && this.pageSize > DEFAULT_PAGE_SIZE){
|
||||
this.pageSize = DEFAULT_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
public <T> Page<T> build() {
|
||||
Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM);
|
||||
Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user