ResponseList<BookingAccountListVO> responseList = new ResponseList();
responseList.setTotal(listVOS.size());
responseList.setPage(searchFilter.getPage());
responseList.setSize(searchFilter.getSize());
responseList.setTotalPage(responseList.getTotal() % searchFilter.getSize() == 0 ? responseList.getTotal() / searchFilter.getSize() : responseList.getTotal() / searchFilter.getSize() + 1);
// 分页
List<BookingAccountListVO> resultList = listVOS.stream()
.skip((searchFilter.getPage() - 1) * searchFilter.getSize())
.limit(searchFilter.getSize())
.collect(Collectors.toList());
responseList.setContent(resultList);
标签:getTotal,分页,searchFilter,代码,getSize,responseList,listVOS
From: https://www.cnblogs.com/xudong5273/p/17613538.html