修正评论数量变量类型转换错误

release-2024-04-25
wangqing 4 months ago
parent 561205000c
commit c9352b4732

@ -416,7 +416,7 @@ public class CommentController extends BaseController {
List<CommentResp> list = (List<CommentResp>) cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_CHILDREN+"_"+parentId,page+"_"+size, key->getChildrenCommentList(parentId,page,size),true).getValue(); List<CommentResp> list = (List<CommentResp>) cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_CHILDREN+"_"+parentId,page+"_"+size, key->getChildrenCommentList(parentId,page,size),true).getValue();
// List<CommentResp> list = getChildrenCommentList(parentId,page,size); // List<CommentResp> list = getChildrenCommentList(parentId,page,size);
//验证是否登录并且拿到ID //验证是否登录并且拿到ID
Integer count = (Integer) cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_CHILDREN_COUNT,parentId, key->getChildrenCommentListCount(parentId,page,size),true).getValue(); Long count = (Long) cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_COMMENT_PAGE_CHILDREN_COUNT,parentId, key->getChildrenCommentListCount(parentId,page,size),true).getValue();
UserLoginDto userLoginDto = getUserLoginDto(authorization); UserLoginDto userLoginDto = getUserLoginDto(authorization);
if (null == userLoginDto) { if (null == userLoginDto) {
@ -425,7 +425,7 @@ public class CommentController extends BaseController {
String userId = userLoginDto.getUserId(); String userId = userLoginDto.getUserId();
Set<String> publicationLikeSet = publicationLikeDao.findAllByUserId(userId).parallelStream().map(p->p.getLikedItemId()).collect(Collectors.toSet()); Set<String> publicationLikeSet = publicationLikeDao.findAllByUserId(userId).parallelStream().map(p->p.getLikedItemId()).collect(Collectors.toSet());
list = list.parallelStream().map(c->updateHaveThumbup(c,publicationLikeSet)).collect(Collectors.toList()); list = list.parallelStream().map(c->updateHaveThumbup(c,publicationLikeSet)).collect(Collectors.toList());
return Result.success(new PageResult<CommentResp>(Long.valueOf(count),list)); return Result.success(new PageResult<CommentResp>(count,list));
} }

Loading…
Cancel
Save