Commit 37586eff authored by 刘基明's avatar 刘基明

消息通知添加话题信息 fix

parent 0926f511
......@@ -49,6 +49,8 @@ public class ThemeNotifyQo {
public String topicTitle;
@ApiModelProperty(value = "评论/转发内容")
private String content;
@ApiModelProperty(value = "转发类型-主题id")
private String forwardThemeId;
@ApiModelProperty(value = "引用的主题id")
public String formerThemeId;
......
......@@ -15,4 +15,6 @@ public class NotificationForwardDO {
private String topicId;
private String themeId;
}
......@@ -414,7 +414,7 @@ public class ThemeManager {
themeService.insertTheme(themeEntity);
// 消息通知
ThemeEntity formerTheme = themeService.queryByThemeId(req.getFormerThemeId());
notificationService.insertForward(userId, formerTheme.getAuthorId(), formerTheme.getThemeId(), req.getTopicId(), req.getContent().get(0).getValue());
notificationService.insertForward(userId, formerTheme.getAuthorId(), formerTheme.getThemeId(), req.getTopicId(), req.getContent().get(0).getValue(),themeEntity.getThemeId());
notificationService.putNotifyCache(formerTheme.getAuthorId(),userId,NotificationTypeEnum.FORWARD);
} else {
......
......@@ -70,15 +70,15 @@ public class NotificationService {
}
public void insertForward(String operatorId,String notifierId,String themeId,String topicId,String text){
NotificationForwardDO forwardDO = NotificationForwardDO.builder().topicId(topicId).content(text).build();
public void insertForward(String operatorId,String notifierId,String forwardThemeId,String topicId,String text,String themeId){
NotificationForwardDO forwardDO = NotificationForwardDO.builder().topicId(topicId).content(text).themeId(themeId).build();
NotificationEntity entity = NotificationEntity.builder().operatorId(operatorId)
.notificationId(uuidGenHelper.getUuidStr())
.notifiedUserId(notifierId)
.messageType(NotificationTypeEnum.FORWARD.getCode())
.content(JsonUtil.toJson(forwardDO))
.operatorId(operatorId)
.targetId(themeId)
.targetId(forwardThemeId)
.build();
insert(entity);
......
......@@ -259,12 +259,10 @@ public class ConvertUtil {
NotificationForwardDO forwardDO = JsonUtil.toBean(entity.getContent(), NotificationForwardDO.class);
themeNotifyQo.setContent(forwardDO.getContent());
themeNotifyQo.setTopicId(forwardDO.getTopicId());
themeNotifyQo.setForwardThemeId(forwardDO.getThemeId());
}catch (Exception e){
throw new BizException("消息通知-转发类型-反序列化异常:"+ entity.getContent());
}
}
}
// 点赞需要聚合头像和人数
......
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