Commit 0f31bc4b authored by 刘基明's avatar 刘基明

消息通知添加话题信息

parent 7f1321ad
......@@ -56,6 +56,10 @@ public class ThemeNotifyQo {
public String formerContent;
@ApiModelProperty(value = "引用的主题用户昵称")
public String formerUserName;
@ApiModelProperty(value = "引用的主题的话题id")
public String formerTopicId;
@ApiModelProperty(value = "引用的主题的话题名称")
public String formerTopicTitle;
// 点赞聚合
@ApiModelProperty(value = "用户id")
......
......@@ -22,7 +22,6 @@ import com.tanpu.community.dao.entity.community.CommentEntity;
import com.tanpu.community.dao.entity.community.FollowRelEntity;
import com.tanpu.community.dao.entity.community.NotificationEntity;
import com.tanpu.community.dao.entity.community.ThemeEntity;
import com.tanpu.community.dao.entity.community.TopicEntity;
import com.tanpu.community.feign.fatools.FeignClientForFatools;
import com.tanpu.community.service.BatchFeignCallService;
import com.tanpu.community.service.CollectionService;
......@@ -98,6 +97,10 @@ public class NotificationManager {
ThemeEntity former = themeService.queryByThemeId(themeNotifyQo.getFormerThemeId());
if (former != null) {
themeNotifyQo.setFormerUserName(currentUser.getNickName());
if (StringUtils.isNotBlank(former.getTopicId())){
themeNotifyQo.setFormerTopicId(former.getTopicId());
themeNotifyQo.setFormerTopicTitle(topicService.queryTitleById(former.getTopicId()));
}
if (ThemeTypeEnum.DISCUSSION.getCode().equals(former.getThemeType()) || ThemeTypeEnum.FORWARD.getCode().equals(former.getThemeType())) {
List<ThemeContentQo> themeContentQos = JsonUtil.toBean(former.getContent(), new TypeReference<List<ThemeContentQo>>() {
});
......@@ -110,8 +113,7 @@ public class NotificationManager {
}
// 话题
if (StringUtils.isNotBlank(themeNotifyQo.getTopicId())) {
TopicEntity topicEntity = topicService.queryById(themeNotifyQo.getTopicId());
themeNotifyQo.setTopicTitle(topicEntity.getTopicTitle());
themeNotifyQo.setFormerTopicTitle(topicService.queryTitleById(themeNotifyQo.getTopicId()));
}
// 点赞聚合
if (themeNotifyQo.getLikeUserCount()!=null && themeNotifyQo.getLikeUserCount()>1) {
......
......@@ -81,6 +81,13 @@ public class TopicService {
.eq(TopicEntity::getDeleteTag, StatusEnum.FALSE));
}
public String queryTitleById(String topicId) {
return topicMapper.selectOne(new LambdaQueryWrapper<TopicEntity>()
.eq(TopicEntity::getTopicId, topicId)
.eq(TopicEntity::getIsConceal, StatusEnum.FALSE)
.eq(TopicEntity::getDeleteTag, StatusEnum.FALSE)).getTopicTitle();
}
public List<TopicEntity> queryByIds(List<String> topicIds) {
if (CollectionUtils.isEmpty(topicIds)) {
return Collections.emptyList();
......
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