Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
5627b769
Commit
5627b769
authored
Feb 11, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新问题发布
parent
18ad796d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
21 deletions
+20
-21
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
+3
-3
src/main/java/cn/meteor/beyondclouds/modules/post/service/impl/PostServiceImpl.java
+2
-4
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectServiceImpl.java
+3
-3
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
+3
-3
src/main/java/cn/meteor/beyondclouds/modules/queue/service/IMessageQueueService.java
+1
-1
src/main/java/cn/meteor/beyondclouds/modules/queue/service/impl/MessageQueueServiceImpl.java
+1
-1
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserFollowServiceImpl.java
+2
-2
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserServiceImpl.java
+3
-3
src/test/java/cn/meteor/beyondclouds/modules/queue/service/impl/MessageQueueServiceImplTest.java
+2
-1
No files found.
src/main/java/cn/meteor/beyondclouds/modules/blog/service/impl/BlogServiceImpl.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
BLOG
,
blog
.
getBlogId
())
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
BLOG
,
blog
.
getBlogId
())
);
);
...
...
src/main/java/cn/meteor/beyondclouds/modules/post/service/impl/PostServiceImpl.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
DataItemChangeMessage
.
addMessage
(
DataItemType
.
POST
,
post
.
getPostId
()));
messageQueueService
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
DataItemChangeMessage
.
deleteMessage
(
DataItemType
.
POST
,
post
.
getPostId
()));
messageQueueService
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
deleteMessage
(
DataItemType
.
POST
,
post
.
getPostId
()));
}
}
...
...
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectServiceImpl.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
PROJECT
,
project
.
getProjectId
())
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
PROJECT
,
project
.
getProjectId
())
);
);
...
...
src/main/java/cn/meteor/beyondclouds/modules/question/service/impl/QuestionServiceImpl.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
QUESTION
,
question
.
getQuestionId
())
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
QUESTION
,
question
.
getQuestionId
())
);
);
}
}
...
...
src/main/java/cn/meteor/beyondclouds/modules/queue/service/IMessageQueueService.java
View file @
5627b769
...
@@ -13,7 +13,7 @@ public interface IMessageQueueService {
...
@@ -13,7 +13,7 @@ public interface IMessageQueueService {
* 发送搜索条目更新消息
* 发送搜索条目更新消息
* @param itemUpdateMessage
* @param itemUpdateMessage
*/
*/
void
send
ItemUpdat
eMessage
(
DataItemChangeMessage
itemUpdateMessage
);
void
send
DataItemChang
eMessage
(
DataItemChangeMessage
itemUpdateMessage
);
/**
/**
* 发送用户行为消息
* 发送用户行为消息
...
...
src/main/java/cn/meteor/beyondclouds/modules/queue/service/impl/MessageQueueServiceImpl.java
View file @
5627b769
...
@@ -28,7 +28,7 @@ public class MessageQueueServiceImpl implements IMessageQueueService {
...
@@ -28,7 +28,7 @@ public class MessageQueueServiceImpl implements IMessageQueueService {
}
}
@Override
@Override
public
void
send
ItemUpdat
eMessage
(
DataItemChangeMessage
itemUpdateMessage
)
{
public
void
send
DataItemChang
eMessage
(
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
());
...
...
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserFollowServiceImpl.java
View file @
5627b769
...
@@ -128,7 +128,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
...
@@ -128,7 +128,7 @@ public class UserFollowServiceImpl extends ServiceImpl<UserFollowMapper, UserFol
}
}
// 发送消息
// 发送消息
messageQueueService
.
send
ItemUpdat
eMessage
(
DataItemChangeMessage
.
addMessage
(
DataItemType
.
USER_FOLLOW
,
userFollow
.
getUserFollowId
()));
messageQueueService
.
send
DataItemChang
eMessage
(
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
.
send
ItemUpdat
eMessage
(
DataItemChangeMessage
.
deleteMessage
(
DataItemType
.
USER_FOLLOW
,
userFollow
.
getUserFollowId
()));
messageQueueService
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
deleteMessage
(
DataItemType
.
USER_FOLLOW
,
userFollow
.
getUserFollowId
()));
}
}
/**
/**
...
...
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserServiceImpl.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
userNickUpdateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
DataItemChangeMessage
.
userNickUpdateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
);
);
}
}
if
(
userAvatarUpdate
)
{
if
(
userAvatarUpdate
)
{
messageQueueService
messageQueueService
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
userAvatarUpdateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
DataItemChangeMessage
.
userAvatarUpdateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
);
);
}
}
// 发送消息到消息队列
// 发送消息到消息队列
messageQueueService
messageQueueService
.
send
ItemUpdat
eMessage
(
.
send
DataItemChang
eMessage
(
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
DataItemChangeMessage
.
updateMessage
(
DataItemType
.
USER
,
user
.
getUserId
())
);
);
}
}
...
...
src/test/java/cn/meteor/beyondclouds/modules/queue/service/impl/MessageQueueServiceImplTest.java
View file @
5627b769
...
@@ -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
.
send
ItemUpdat
eMessage
(
itemUpdateMessage
);
messageQueueService
.
send
DataItemChang
eMessage
(
itemUpdateMessage
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment