use of com.topcom.cms.es.vo.AggPageImpl in project topcom-cloud by 545314690.
the class UserStyleController method findAllGroupAndUsersyle.
@ApiOperation("查询group列表")
@RequestMapping(value = { "findAllGroupAndUsersyle" }, method = { RequestMethod.POST }, produces = { "application/json" }, consumes = { "application/json" })
@ResponseBody
public Page findAllGroupAndUsersyle(@RequestBody PageRequest page) {
Page<Group> groupPage = groupManager.findAll(page.pageable());
List<GroupStyle> contentList = new ArrayList<>();
for (Group group : groupPage.getContent()) {
Long groupId = group.getId();
UserStyle userStyle = this.userStyleManager.findByGroupId(groupId);
GroupStyle groupStyle;
if (userStyle != null) {
groupStyle = new GroupStyle(group, userStyle);
} else {
groupStyle = new GroupStyle(group);
}
contentList.add(groupStyle);
}
Page result = new AggPageImpl<>(contentList, groupPage.getTotalPages(), groupPage.getTotalElements(), page.pageable());
return result;
}
Aggregations