TASK: 全局异常优化;

This commit is contained in:
shahaibo
2023-10-31 14:07:43 +08:00
parent 68d28995b8
commit 44a30bf9b5
40 changed files with 517 additions and 211 deletions

View File

@@ -1,5 +1,6 @@
package com.ai.da.controller;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.context.UserContext;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.PageResponse;
@@ -75,7 +76,9 @@ public class SavedCollectionController {
}
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!");
if (CollectionUtils.isEmpty(groupDetails)) {
throw new BusinessException("groupDetails.not.found");
}
Map<Long, List<UserLikeVO>> groupDetailMap = groupDetails.stream()
.collect(Collectors.groupingBy(UserLikeVO::getUserLikeGroupId));