BUGFIX: format;
This commit is contained in:
@@ -58,32 +58,32 @@ public class SavedCollectionController {
|
||||
QueryWrapper<UserLikeGroup> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("account_id", authPrincipalVo.getId());
|
||||
if(!StringUtils.isEmpty(query.getCollectionName())){
|
||||
if (!StringUtils.isEmpty(query.getCollectionName())) {
|
||||
queryWrapper.like("name", query.getCollectionName());
|
||||
}
|
||||
if(Objects.nonNull(query.getStartDate())){
|
||||
if (Objects.nonNull(query.getStartDate())) {
|
||||
queryWrapper.ge("update_date", new Date(query.getStartDate()));
|
||||
}
|
||||
if(Objects.nonNull(query.getEndDate())){
|
||||
if (Objects.nonNull(query.getEndDate())) {
|
||||
queryWrapper.le("update_date", new Date(query.getEndDate()));
|
||||
}
|
||||
queryWrapper.orderByDesc("id");
|
||||
IPage<UserLikeGroup> page = userLikeGroupService.getBaseMapper().selectPage(
|
||||
new Page<>(query.getPage(), query.getSize()), queryWrapper);
|
||||
if(CollectionUtils.isEmpty(page.getRecords())){
|
||||
if (CollectionUtils.isEmpty(page.getRecords())) {
|
||||
return Response.success(PageBaseResponse.success(new Page<>()));
|
||||
}
|
||||
List<Long> groupIds = page.getRecords().stream().map(UserLikeGroup::getId).collect(Collectors.toList());
|
||||
List<UserLikeVO> groupDetails = userLikeService.getGroupDetails(groupIds);
|
||||
Assert.notEmpty(groupDetails,"History detail does not exist!");
|
||||
Map<Long,List<UserLikeVO>> groupDetailMap = groupDetails.stream()
|
||||
Assert.notEmpty(groupDetails, "History detail does not exist!");
|
||||
Map<Long, List<UserLikeVO>> groupDetailMap = groupDetails.stream()
|
||||
.collect(Collectors.groupingBy(UserLikeVO::getUserLikeGroupId));
|
||||
|
||||
Account account = accountService.getById(authPrincipalVo.getId());
|
||||
Account account = accountService.getById(authPrincipalVo.getId());
|
||||
IPage<UserLikeGroupVO> convert = page.convert((Function<UserLikeGroup, UserLikeGroupVO>) group -> {
|
||||
if(group != null){
|
||||
UserLikeGroupVO userLikeGroupVO = CopyUtil.copyObject(group,UserLikeGroupVO.class);
|
||||
userLikeGroupVO.setUpdateDate(group.getUpdateDate().getTime());
|
||||
if (group != null) {
|
||||
UserLikeGroupVO userLikeGroupVO = CopyUtil.copyObject(group, UserLikeGroupVO.class);
|
||||
userLikeGroupVO.setUpdateDate(group.getUpdateDate().getTime());
|
||||
userLikeGroupVO.setAuthor(account.getUserName());
|
||||
//count 和detail
|
||||
List<UserLikeVO> details = groupDetailMap.get(group.getId());
|
||||
@@ -91,7 +91,7 @@ public class SavedCollectionController {
|
||||
detail.setUrl(minioUtil.getPresignedUrl(detail.getUrl(), 24 * 60));
|
||||
}
|
||||
userLikeGroupVO.setGroupDetails(details);
|
||||
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 :details.size());
|
||||
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
|
||||
return userLikeGroupVO;
|
||||
}
|
||||
return null;
|
||||
@@ -110,7 +110,7 @@ public class SavedCollectionController {
|
||||
@PostMapping("/updateUserGroupName")
|
||||
public Response<HistoryUpdateVO> updateUserGroupName(@Valid @RequestBody HistoryUpdateDTO historyUpdateDTO) {
|
||||
return Response.success(userLikeGroupService.updateUserGroupName(historyUpdateDTO.getUserGroupId()
|
||||
,historyUpdateDTO.getUserGroupName(),historyUpdateDTO.getTimeZone()));
|
||||
, historyUpdateDTO.getUserGroupName(), historyUpdateDTO.getTimeZone()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "History删除用户分组")
|
||||
@@ -124,7 +124,7 @@ public class SavedCollectionController {
|
||||
@ApiOperation(value = "History choose")
|
||||
@GetMapping("/choose")
|
||||
public Response<UserLikeChooseVO> choose(
|
||||
@ApiParam("用户分组id") @RequestParam("userGroupId") Long userGroupId) {
|
||||
@ApiParam("用户分组id") @RequestParam("userGroupId") Long userGroupId) {
|
||||
return Response.success(userLikeGroupService.choose(userGroupId));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user