本文整理了Java中com.github.pagehelper.PageInfo.getList()
方法的一些代码示例,展示了PageInfo.getList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PageInfo.getList()
方法的具体详情如下:
包路径:com.github.pagehelper.PageInfo
类名称:PageInfo
方法名:getList
暂无
代码示例来源:origin: ZHENFENG13/My-Blog
/**
* 判断分页中是否有数据
*
* @param paginator
* @return
*/
public static boolean is_empty(PageInfo paginator) {
return paginator == null || (paginator.getList() == null) || (paginator.getList().size() == 0);
}
代码示例来源:origin: wuyouzhuguli/FEBS-Shiro
private Map<String, Object> getDataTable(PageInfo<?> pageInfo) {
Map<String, Object> rspData = new HashMap<>();
rspData.put("rows", pageInfo.getList());
rspData.put("total", pageInfo.getTotal());
return rspData;
}
代码示例来源:origin: macrozheng/mall
/**
* 返回分页成功数据
*/
public CommonResult pageSuccess(List data) {
PageInfo pageInfo = new PageInfo(data);
Map<String, Object> result = new HashMap<>();
result.put("pageSize", pageInfo.getPageSize());
result.put("totalPage", pageInfo.getPages());
result.put("total", pageInfo.getTotal());
result.put("pageNum", pageInfo.getPageNum());
result.put("list", pageInfo.getList());
this.code = SUCCESS;
this.message = "操作成功";
this.data = result;
return this;
}
代码示例来源:origin: macrozheng/mall
/**
* 返回分页成功数据
*/
public CommonResult pageSuccess(List data) {
PageInfo pageInfo = new PageInfo(data);
long totalPage = pageInfo.getTotal() / pageInfo.getPageSize();
Map<String, Object> result = new HashMap<>();
result.put("pageSize", pageInfo.getPageSize());
result.put("totalPage", totalPage);
result.put("pageNum", pageInfo.getPageNum());
result.put("list", pageInfo.getList());
this.code = SUCCESS;
this.message = "操作成功";
this.data = result;
return this;
}
代码示例来源:origin: nice-swa/my-site
/**
* 判断分页中是否有数据
*
* @param paginator
* @return
*/
public static boolean is_empty(PageInfo paginator) {
return paginator == null || (paginator.getList() == null) || (paginator.getList().size() == 0);
}
代码示例来源:origin: nice-swa/my-site
@ApiOperation("进入首页")
@GetMapping(value = {"","/index"})
public String index(HttpServletRequest request){
LOGGER.info("Enter admin index method");
List<CommentDomain> comments = siteService.getComments(5);
List<ContentDomain> contents = siteService.getNewArticles(5);
StatisticsDto statistics = siteService.getStatistics();
// 取最新的20条日志
PageInfo<LogDomain> logs = logService.getLogs(1, 5);
List<LogDomain> list = logs.getList();
request.setAttribute("comments", comments);
request.setAttribute("articles", contents);
request.setAttribute("statistics", statistics);
request.setAttribute("logs", list);
LOGGER.info("Exit admin index method");
return "admin/index";
}
代码示例来源:origin: JayTange/Jantent
/**
* 判断分页中是否有数据
*
* @param paginator
* @return
*/
public static boolean is_empty(PageInfo paginator) {
return paginator == null || (paginator.getList() == null) || (paginator.getList().size() == 0);
}
代码示例来源:origin: liuyuyu/dictator
public static <A, B> PageInfo<B> to(@NonNull PageInfo<A> sourcePageInfo, Function<A, B> mapFunction) {
PageInfo<B> resultPageInfo = new PageInfo<>();
BeanUtils.copyProperties(sourcePageInfo, resultPageInfo);
List<B> collect = sourcePageInfo.getList().stream()
.map(mapFunction)
.collect(Collectors.toList());
resultPageInfo.setList(collect);
return resultPageInfo;
}
}
代码示例来源:origin: coder-yqj/springboot-shiro
@RequestMapping
public Map<String,Object> getAll(Role role, String draw,
@RequestParam(required = false, defaultValue = "1") int start,
@RequestParam(required = false, defaultValue = "10") int length){
Map<String,Object> map = new HashMap<>();
PageInfo<Role> pageInfo = roleService.selectByPage(role, start, length);
map.put("draw",draw);
map.put("recordsTotal",pageInfo.getTotal());
map.put("recordsFiltered",pageInfo.getTotal());
map.put("data", pageInfo.getList());
return map;
}
代码示例来源:origin: zhangyd-c/OneBlog
public static PageResult tablePage(PageInfo info) {
if (info == null) {
return new PageResult(0L, new ArrayList());
}
return tablePage(info.getTotal(), info.getList());
}
代码示例来源:origin: java-aodeng/hope-plus
public static PageResultVo tablePage(PageInfo pageInfo){
if (pageInfo == null){
return new PageResultVo(0L,new ArrayList());
}
return tablePage(pageInfo.getTotal(),pageInfo.getList());
}
}
代码示例来源:origin: liuyuyu/dictator
public static <A, B> PageInfo<B> to(@NonNull PageInfo<A> sourcePageInfo, @NonNull Class<B> targetClass) {
PageInfo<B> resultPageInfo = new PageInfo<>();
BeanUtils.copyProperties(sourcePageInfo, resultPageInfo);
List<B> list = BeanConverter.from(sourcePageInfo.getList())
.toList(targetClass);
resultPageInfo.setList(list);
return resultPageInfo;
}
代码示例来源:origin: songxinjianqwe/EShop-SOA
@Transactional(readOnly = true)
@Override
public PageInfo<OrderDO> findAllByCondition(OrderQueryConditionDTO queryDTO, Integer pageNum, Integer pageSize) {
if (queryDTO.getCategoryId() != null) {
queryDTO.setProductIds(productService.findProductIdsByCategory(queryDTO.getCategoryId()));
}
PageInfo<OrderDO> page = mapper.findByCondition(queryDTO, pageNum, pageSize).toPageInfo();
page.getList().forEach(order -> populateBean(order));
return page;
}
代码示例来源:origin: zhangyd-c/OneBlog
/**
* 查询已禁用的友情链接列表
*
* @return
*/
@Override
@RedisCache
public List<Link> listOfDisable() {
LinkConditionVO vo = new LinkConditionVO(0, null);
vo.setPageSize(100);
PageInfo<Link> pageInfo = this.findPageBreakByCondition(vo);
return pageInfo == null ? null : pageInfo.getList();
}
代码示例来源:origin: babylikebird/common-admin
/**
*
* @param page
*/
public PageBean(PageInfo<T> page) {
this.iDisplayStart = page.getStartRow();
this.iDisplayLength = page.getPageSize();
this.iTotalRecords = (int)page.getTotal();
this.iTotalDisplayRecords = (int)page.getTotal();
this.data = page.getList();
}
代码示例来源:origin: xkcoding/spring-boot-demo
@GetMapping
public ResponseEntity<ApiResponse> jobList(Integer currentPage, Integer pageSize) {
if (ObjectUtil.isNull(currentPage)) {
currentPage = 1;
}
if (ObjectUtil.isNull(pageSize)) {
pageSize = 10;
}
PageInfo<JobAndTrigger> all = jobService.list(currentPage, pageSize);
return ResponseEntity.ok(ApiResponse.ok(Dict.create().set("total", all.getTotal()).set("data", all.getList())));
}
代码示例来源:origin: tigerphz/tgcloud-master
@RequestMapping(value = "", method = RequestMethod.GET)
@ApiOperation("获取所有用户信息")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "param", dataType = "UserParam", value = "查询条件")
})
public Wrapper<PageInfo<UserVO>> list(UserParam param) {
param.setType(UserTypeEnum.OPERATE.getKey());
PageInfo<UserInfo> userInfoPageInfo = userService.selectByConditionWithPage(param);
List<UserVO> userList = userMapping.from(userInfoPageInfo.getList());
PageInfo<UserVO> userVOPageInfo = new PageInfo<>(userList);
return WrapMapper.ok(userVOPageInfo);
}
代码示例来源:origin: xiangwbs/springboot
public Pagination(PageInfo pageInfo) {
super();
this.currentPage = pageInfo.getPageNum();
this.pageSize = pageInfo.getPageSize();
this.totalNum = pageInfo.getTotal();
this.totalPage = pageInfo.getPages();
this.items = (List<T>) ConvertUtil.beanToJson(pageInfo.getList());
this.hasNext = pageInfo.isHasNextPage();
}
代码示例来源:origin: nbfujx/Goku.WebService
public TablePage getDataForPaging(PageInfo pageInfo)
{
TablePage tp=new TablePage();
tp.setCode(0);
tp.setMsg("");
tp.setTotal(pageInfo.getTotal());
tp.setRows(pageInfo.getList());
return tp;
}
}
代码示例来源:origin: xiangwbs/springboot
public Pagination result(Pagination page, PageInfo pageInfo) {
page.setTotalNum(pageInfo.getTotal());
page.setTotalPage(pageInfo.getPages());
page.setItems((List) ConvertUtil.beanToJson(pageInfo.getList()));
page.setHasNext(pageInfo.isHasNextPage());
return page;
}
}
内容来源于网络,如有侵权,请联系作者删除!