Commit 102b435b authored by 刘基明's avatar 刘基明

话题列表fix

parent b9de5ab4
......@@ -24,7 +24,7 @@ public class ThemeQo {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "类型 1:讨论无标题 2:长文有标题 3:转发")
@ApiModelProperty(value = "类型 1:讨论无标题 2:长文有标题 3:转发 4:评论")
private Integer themeType;
@ApiModelProperty(value = "内容")
......
......@@ -13,7 +13,7 @@ public class QueryRecordThemeReq {
@ApiModelProperty("用户Id")
private String userId;
@ApiModelProperty(value = "操作类型 1:发布 2:点赞 3:收藏")
@ApiModelProperty(value = "操作类型 1:发布 2:回复 3:点赞 4:收藏")
private Integer recordType;
@ApiModelProperty(value = "当前浏览的最后一个themeId,可以为空")
......
......@@ -113,11 +113,26 @@ public class ThemeManager {
case 1://发布
themeEntities = themeService.queryThemeIdsByUserId(req.getUserId());
break;
case 2://点赞
case 2://回复
List<CommentEntity> commentEntities = commentService.queryThemesByUserId(req.getUserId());
Set<String> replyThemeIds = commentEntities.stream().map(CommentEntity::getThemeId).collect(Collectors.toSet());
themeEntities = themeService.queryByThemeIds(new ArrayList<>(replyThemeIds));
List<ThemeQo> themeQos = convertEntityToQo(themeEntities, userId);
for (ThemeQo themeQo : themeQos) {
FormerThemeQo f = FormerThemeQo.builder().formerThemeId(themeQo.getThemeId())
.forwardContent(themeQo.getContent())
.userImg(themeQo.getUserImg())
.nickName(themeQo.getNickName())
.build();
themeQo.setFormerTheme(f);
}
break;
case 3://点赞
Set<String> likeThemeIds = collectionService.getListByUser(userId, CollectionTypeEnum.LIKE_THEME);
themeEntities = themeService.queryByThemeIds(new ArrayList<>(likeThemeIds));
break;
case 3://收藏
case 4://收藏
Set<String> collectThemeIds = collectionService.getListByUser(userId, CollectionTypeEnum.COLLECT_THEME);
themeEntities = themeService.queryByThemeIds(new ArrayList<>(collectThemeIds));
break;
......@@ -231,6 +246,7 @@ public class ThemeManager {
for (ThemeQo themeQO : themeQos) {
buildThemeQoExtraInfo(userId, themeQO);
}
return themeQos;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment