remove 移除分页合理化参数 使用 MP 全局配置分页溢出
| | |
| | | public static final String IS_ASC = "isAsc"; |
| | | |
| | | /** |
| | | * 分页参数合理化 |
| | | */ |
| | | private static final String REASONABLE = "reasonable"; |
| | | |
| | | /** |
| | | * 当前记录起始索引 默认值 |
| | | */ |
| | | public static final int DEFAULT_PAGE_NUM = 1; |
| | |
| | | * 每页显示记录数 默认值 默认查全部 |
| | | */ |
| | | public static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; |
| | | |
| | | /** |
| | | * 分页参数合理化 默认值 |
| | | */ |
| | | private static final Boolean DEFAULT_REASONABLE = Boolean.TRUE; |
| | | |
| | | /** |
| | | * 构建 plus 分页对象 |
| | |
| | | Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE); |
| | | String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN); |
| | | String isAsc = ServletUtils.getParameter(IS_ASC); |
| | | Boolean reasonable = ServletUtils.getParameterToBool(REASONABLE, DEFAULT_REASONABLE); |
| | | //分页合理化,针对不合理的页码自动处理 |
| | | if (reasonable && pageNum <= 0) { |
| | | pageNum = 1; |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | | PagePlus<T, K> page = new PagePlus<>(pageNum, pageSize); |
| | | if (StringUtils.isNotBlank(orderByColumn)) { |
| | |
| | | Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, DEFAULT_PAGE_SIZE); |
| | | String orderByColumn = ServletUtils.getParameter(ORDER_BY_COLUMN, defaultOrderByColumn); |
| | | String isAsc = ServletUtils.getParameter(IS_ASC, defaultIsAsc); |
| | | Boolean reasonable = ServletUtils.getParameterToBool(REASONABLE, DEFAULT_REASONABLE); |
| | | //分页合理化,针对不合理的页码自动处理 |
| | | if (reasonable && pageNum <= 0) { |
| | | pageNum = 1; |
| | | if (pageNum <= 0) { |
| | | pageNum = DEFAULT_PAGE_NUM; |
| | | } |
| | | // 兼容前端排序类型 |
| | | if ("ascending".equals(isAsc)) { |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | #foreach ($column in $columns) |
| | | #if($column.query) |
| | | $column.javaField: undefined#if($velocityCount != $columns.size()),#end |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | testKey: undefined, |
| | | value: undefined, |
| | | createTime: undefined, |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | jobName: undefined, |
| | | jobGroup: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | jobName: undefined, |
| | | jobGroup: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | ipaddr: undefined, |
| | | userName: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | configName: undefined, |
| | | configKey: undefined, |
| | | configType: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | dictName: undefined, |
| | | dictType: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | dictName: undefined, |
| | | dictType: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | noticeTitle: undefined, |
| | | createBy: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | configKey: undefined, |
| | | bucketName: undefined, |
| | | status: undefined, |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | fileName: undefined, |
| | | originalName: undefined, |
| | | fileSuffix: undefined, |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | postCode: undefined, |
| | | postName: undefined, |
| | | status: undefined |
| | |
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | reasonable: true,
|
| | | roleId: undefined,
|
| | | userName: undefined,
|
| | | phonenumber: undefined
|
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | roleName: undefined, |
| | | roleKey: undefined, |
| | | status: undefined |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | userName: undefined, |
| | | phonenumber: undefined, |
| | | status: undefined, |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | reasonable: true, |
| | | tableName: undefined, |
| | | tableComment: undefined |
| | | }, |