Pre Merge pull request !208 from 瘦八爷/master
This commit is contained in:
commit
1f48a60623
|
|
@ -35,7 +35,7 @@ public class SysIndexController extends BaseController
|
|||
private ISysConfigService configService;
|
||||
|
||||
// 系统首页
|
||||
@GetMapping("/index")
|
||||
@GetMapping({"/index","/"})
|
||||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
|
|
|
|||
|
|
@ -52,11 +52,21 @@ public class Constants
|
|||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引默认值
|
||||
*/
|
||||
public static final int PAGE_NUM_DEFAULT_VALUE = 1;
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 每页显示记录数默认值
|
||||
*/
|
||||
public static final int PAGE_SIZE_DEFAULT_VALUE = 10;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,11 +56,8 @@ public class BaseController
|
|||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ public class TableSupport
|
|||
public static PageDomain getPageDomain()
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM, Constants.PAGE_NUM_DEFAULT_VALUE));
|
||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE, Constants.PAGE_SIZE_DEFAULT_VALUE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
||||
return pageDomain;
|
||||
|
|
|
|||
Loading…
Reference in New Issue