|
@@ -1,6 +1,5 @@
|
|
package com.ruoyi.common.core.page;
|
|
package com.ruoyi.common.core.page;
|
|
|
|
|
|
-import com.ruoyi.common.constant.Constants;
|
|
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -11,15 +10,41 @@ import com.ruoyi.common.utils.ServletUtils;
|
|
public class TableSupport
|
|
public class TableSupport
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
|
|
+ * 当前记录起始索引
|
|
|
|
+ */
|
|
|
|
+ public static final String PAGE_NUM = "pageNum";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 每页显示记录数
|
|
|
|
+ */
|
|
|
|
+ public static final String PAGE_SIZE = "pageSize";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 排序列
|
|
|
|
+ */
|
|
|
|
+ public static final String ORDER_BY_COLUMN = "orderByColumn";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 排序的方向 "desc" 或者 "asc".
|
|
|
|
+ */
|
|
|
|
+ public static final String IS_ASC = "isAsc";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页参数合理化
|
|
|
|
+ */
|
|
|
|
+ public static final String REASONABLE = "reasonable";
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 封装分页对象
|
|
* 封装分页对象
|
|
*/
|
|
*/
|
|
public static PageDomain getPageDomain()
|
|
public static PageDomain getPageDomain()
|
|
{
|
|
{
|
|
PageDomain pageDomain = new PageDomain();
|
|
PageDomain pageDomain = new PageDomain();
|
|
- pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
|
|
|
- pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
|
|
|
- pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
|
|
|
- pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
|
|
|
|
|
+ pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));
|
|
|
|
+ pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
|
|
|
|
+ pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
|
|
|
|
+ pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
|
|
|
|
+ pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
|
|
return pageDomain;
|
|
return pageDomain;
|
|
}
|
|
}
|
|
|
|
|