Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-message
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
hqzhdj
cloud-message
Commits
9df7c716
Commit
9df7c716
authored
Feb 19, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息优化
parent
512e82f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
cloud-newMessage-service/src/main/java/com/yizhi/message/application/event/MessageEventListener.java
+8
-5
cloud-newMessage-service/src/main/java/com/yizhi/message/application/service/impl/MessageServiceImple.java
+3
-2
No files found.
cloud-newMessage-service/src/main/java/com/yizhi/message/application/event/MessageEventListener.java
View file @
9df7c716
...
...
@@ -7,20 +7,23 @@ import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Author: shengchenglong
* @Date: 2018/4/18 11:14
*/
@Component
@RabbitListener
(
queues
=
Constans
.
MESSAGE_QUEUE
)
public
class
MessageEventListener
{
@RestController
public
class
MessageEventListener
{
@Autowired
private
MessageEventHandler
messageEventHandler
;
@
RabbitHandler
public
void
processBizEvent
(
EventWrapper
<
MessageRemindVo
>
ew
)
{
@
PostMapping
(
"/remote/manage/messageAccount/processBizEvent"
)
public
void
processBizEvent
(
@RequestBody
EventWrapper
<
MessageRemindVo
>
ew
)
{
messageEventHandler
.
handle
(
ew
);
}
...
...
cloud-newMessage-service/src/main/java/com/yizhi/message/application/service/impl/MessageServiceImple.java
View file @
9df7c716
...
...
@@ -13,6 +13,7 @@ import com.yizhi.message.application.controller.util.MessageUtil;
import
com.yizhi.message.application.controller.util.QueryAccount
;
import
com.yizhi.message.application.domain.*
;
import
com.yizhi.message.application.enums.MessageStatus
;
import
com.yizhi.message.application.event.MessageEventHandler
;
import
com.yizhi.message.application.mapper.MessageMapper
;
import
com.yizhi.message.application.service.*
;
import
com.yizhi.message.application.vo.*
;
...
...
@@ -72,7 +73,7 @@ public class MessageServiceImple extends ServiceImpl<MessageMapper, Message> imp
@Autowired
private
MessageParameterService
messageParameterService
;
@Autowired
private
CloudEventPublisher
cloudEventPublish
er
;
private
MessageEventHandler
messageEventHandl
er
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
MessageServiceImple
.
class
);
...
...
@@ -658,7 +659,7 @@ public class MessageServiceImple extends ServiceImpl<MessageMapper, Message> imp
vo1
.
setRequestContext
(
context
);
try
{
cloudEventPublisher
.
publish
(
Constans
.
MESSAGE_QUEUE
,
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo1
));
messageEventHandler
.
handle
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo1
));
d
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
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