假分页
Posted charkey
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了假分页相关的知识,希望对你有一定的参考价值。
foton中因为hbase没有封装分页的方法,如果前端QUI要支持分页,代码为:
@SysLog(name = "查询列表") @RequestMapping(method = RequestMethod.POST, RequestMethod.GET ) @JSON(properties = @JSONProperty(root = "list", property = "*" ) ) public String listByDay() HttpServletRequest request = getRequest(); String apiId = request.getParameter("apiId"); String userId = request.getParameter("userId"); Date dataDay = ServletUtils.getDateValue(request, "dataDay", DateUtils.DEFAULT_DATE_FORMAT, null); List<AccountRecord> recordList = accountRecordService.findListByDay(Long.valueOf(userId), Long.valueOf(apiId), dataDay); List<AccountRecord> resultList = new ArrayList<AccountRecord>(); int pageNo = Integer.valueOf(request.getParameter("pager.pageNo")); int pageSize = Integer.valueOf(request.getParameter("pager.pageSize")); int size = 0; if (recordList != null && recordList.size() > 0) size = recordList.size(); int fromIndex = pageNo == 1 ? 0 : pageSize * (pageNo - 1); int toIndex = pageNo * pageSize <= size ? pageNo * pageSize : size; resultList = recordList.subList(fromIndex, toIndex); setList(resultList); setTotalCount(size); return ResultType.JSON;
以上是关于假分页的主要内容,如果未能解决你的问题,请参考以下文章