Commit 5627b769 by 段启岩

更新问题发布

parent 18ad796d
...@@ -163,7 +163,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB ...@@ -163,7 +163,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
// 5.发送消息到消息队列 // 5.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.addMessage(DataItemType.BLOG, blog.getBlogId()) DataItemChangeMessage.addMessage(DataItemType.BLOG, blog.getBlogId())
); );
} }
...@@ -214,7 +214,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB ...@@ -214,7 +214,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
// 5.发送消息到消息队列 // 5.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.deleteMessage(DataItemType.BLOG, blog.getBlogId()) DataItemChangeMessage.deleteMessage(DataItemType.BLOG, blog.getBlogId())
); );
} }
...@@ -418,7 +418,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB ...@@ -418,7 +418,7 @@ public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IB
// 5.发送消息到消息队列 // 5.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.updateMessage(DataItemType.BLOG, blog.getBlogId()) DataItemChangeMessage.updateMessage(DataItemType.BLOG, blog.getBlogId())
); );
......
...@@ -3,7 +3,6 @@ package cn.meteor.beyondclouds.modules.post.service.impl; ...@@ -3,7 +3,6 @@ package cn.meteor.beyondclouds.modules.post.service.impl;
import cn.meteor.beyondclouds.core.queue.message.DataItemChangeMessage; import cn.meteor.beyondclouds.core.queue.message.DataItemChangeMessage;
import cn.meteor.beyondclouds.core.queue.message.DataItemType; import cn.meteor.beyondclouds.core.queue.message.DataItemType;
import cn.meteor.beyondclouds.modules.post.entity.Post; import cn.meteor.beyondclouds.modules.post.entity.Post;
import cn.meteor.beyondclouds.modules.post.entity.PostComment;
import cn.meteor.beyondclouds.modules.post.enums.PostErrorCode; import cn.meteor.beyondclouds.modules.post.enums.PostErrorCode;
import cn.meteor.beyondclouds.modules.post.exception.PostServiceException; import cn.meteor.beyondclouds.modules.post.exception.PostServiceException;
import cn.meteor.beyondclouds.modules.post.mapper.PostMapper; import cn.meteor.beyondclouds.modules.post.mapper.PostMapper;
...@@ -19,7 +18,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -19,7 +18,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/** /**
* <p> * <p>
...@@ -81,7 +79,7 @@ public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements IP ...@@ -81,7 +79,7 @@ public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements IP
//2.保存动态 //2.保存动态
save(post); save(post);
messageQueueService.sendItemUpdateMessage(DataItemChangeMessage.addMessage(DataItemType.POST, post.getPostId())); messageQueueService.sendDataItemChangeMessage(DataItemChangeMessage.addMessage(DataItemType.POST, post.getPostId()));
} }
...@@ -105,7 +103,7 @@ public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements IP ...@@ -105,7 +103,7 @@ public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements IP
//2.删除动态 //2.删除动态
removeById(postId); removeById(postId);
messageQueueService.sendItemUpdateMessage(DataItemChangeMessage.deleteMessage(DataItemType.POST, post.getPostId())); messageQueueService.sendDataItemChangeMessage(DataItemChangeMessage.deleteMessage(DataItemType.POST, post.getPostId()));
} }
......
...@@ -115,7 +115,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl ...@@ -115,7 +115,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
// 4.发送消息到消息队列 // 4.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.addMessage(DataItemType.PROJECT, project.getProjectId()) DataItemChangeMessage.addMessage(DataItemType.PROJECT, project.getProjectId())
); );
} }
...@@ -152,7 +152,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl ...@@ -152,7 +152,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
// 4.发送消息到消息队列 // 4.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.deleteMessage(DataItemType.PROJECT, project.getProjectId()) DataItemChangeMessage.deleteMessage(DataItemType.PROJECT, project.getProjectId())
); );
} }
...@@ -252,7 +252,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl ...@@ -252,7 +252,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
// 4.发送消息到消息队列 // 4.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.updateMessage(DataItemType.PROJECT, project.getProjectId()) DataItemChangeMessage.updateMessage(DataItemType.PROJECT, project.getProjectId())
); );
......
...@@ -167,7 +167,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -167,7 +167,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
// 6.发送消息到消息队列 // 6.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.addMessage(DataItemType.QUESTION, question.getQuestionId()) DataItemChangeMessage.addMessage(DataItemType.QUESTION, question.getQuestionId())
); );
} }
...@@ -208,7 +208,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -208,7 +208,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
// 9.发送消息到消息队列 // 9.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.deleteMessage(DataItemType.QUESTION, question.getQuestionId()) DataItemChangeMessage.deleteMessage(DataItemType.QUESTION, question.getQuestionId())
); );
...@@ -258,7 +258,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i ...@@ -258,7 +258,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
// 6.发送消息到消息队列 // 6.发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.updateMessage(DataItemType.QUESTION, question.getQuestionId()) DataItemChangeMessage.updateMessage(DataItemType.QUESTION, question.getQuestionId())
); );
} }
......
...@@ -13,7 +13,7 @@ public interface IMessageQueueService { ...@@ -13,7 +13,7 @@ public interface IMessageQueueService {
* 发送搜索条目更新消息 * 发送搜索条目更新消息
* @param itemUpdateMessage * @param itemUpdateMessage
*/ */
void sendItemUpdateMessage(DataItemChangeMessage itemUpdateMessage); void sendDataItemChangeMessage(DataItemChangeMessage itemUpdateMessage);
/** /**
* 发送用户行为消息 * 发送用户行为消息
......
...@@ -28,7 +28,7 @@ public class MessageQueueServiceImpl implements IMessageQueueService { ...@@ -28,7 +28,7 @@ public class MessageQueueServiceImpl implements IMessageQueueService {
} }
@Override @Override
public void sendItemUpdateMessage(DataItemChangeMessage itemUpdateMessage) { public void sendDataItemChangeMessage(DataItemChangeMessage itemUpdateMessage) {
try { try {
kafkaTemplate.send(topicProperties.getDataItemChange(), JsonUtils.toJson(itemUpdateMessage)); kafkaTemplate.send(topicProperties.getDataItemChange(), JsonUtils.toJson(itemUpdateMessage));
log.debug("发送kafka消息:{}", itemUpdateMessage.toString()); log.debug("发送kafka消息:{}", itemUpdateMessage.toString());
......
...@@ -128,7 +128,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol ...@@ -128,7 +128,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
} }
// 发送消息 // 发送消息
messageQueueService.sendItemUpdateMessage(DataItemChangeMessage.addMessage(DataItemType.USER_FOLLOW, userFollow.getUserFollowId())); messageQueueService.sendDataItemChangeMessage(DataItemChangeMessage.addMessage(DataItemType.USER_FOLLOW, userFollow.getUserFollowId()));
} }
...@@ -154,7 +154,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol ...@@ -154,7 +154,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
update(userFollow, userFollowQueryWrapper); update(userFollow, userFollowQueryWrapper);
// 发送消息 // 发送消息
messageQueueService.sendItemUpdateMessage(DataItemChangeMessage.deleteMessage(DataItemType.USER_FOLLOW, userFollow.getUserFollowId())); messageQueueService.sendDataItemChangeMessage(DataItemChangeMessage.deleteMessage(DataItemType.USER_FOLLOW, userFollow.getUserFollowId()));
} }
/** /**
......
...@@ -216,21 +216,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU ...@@ -216,21 +216,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
if (userNickUpdate) { if (userNickUpdate) {
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.userNickUpdateMessage(DataItemType.USER, user.getUserId()) DataItemChangeMessage.userNickUpdateMessage(DataItemType.USER, user.getUserId())
); );
} }
if (userAvatarUpdate) { if (userAvatarUpdate) {
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.userAvatarUpdateMessage(DataItemType.USER, user.getUserId()) DataItemChangeMessage.userAvatarUpdateMessage(DataItemType.USER, user.getUserId())
); );
} }
// 发送消息到消息队列 // 发送消息到消息队列
messageQueueService messageQueueService
.sendItemUpdateMessage( .sendDataItemChangeMessage(
DataItemChangeMessage.updateMessage(DataItemType.USER, user.getUserId()) DataItemChangeMessage.updateMessage(DataItemType.USER, user.getUserId())
); );
} }
......
...@@ -28,6 +28,6 @@ public class MessageQueueServiceImplTest { ...@@ -28,6 +28,6 @@ public class MessageQueueServiceImplTest {
itemUpdateMessage.setItemId("123"); itemUpdateMessage.setItemId("123");
itemUpdateMessage.setItemType(DataItemType.PROJECT); itemUpdateMessage.setItemType(DataItemType.PROJECT);
itemUpdateMessage.setChangeType(DataItemChangeType.ADD); itemUpdateMessage.setChangeType(DataItemChangeType.ADD);
messageQueueService.sendItemUpdateMessage(itemUpdateMessage); messageQueueService.sendDataItemChangeMessage(itemUpdateMessage);
} }
} }
\ No newline at end of file
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