aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common/src')
-rw-r--r--juick-common/src/main/java/com/juick/service/component/NotificationListener.java3
-rw-r--r--juick-common/src/main/java/com/juick/service/component/TopEvent.java21
2 files changed, 24 insertions, 0 deletions
diff --git a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
index 8092e258..38d0490a 100644
--- a/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
+++ b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
@@ -19,4 +19,7 @@ public interface NotificationListener {
@Async
@EventListener
void processMessageReadEvent(MessageReadEvent messageReadEvent);
+ @Async
+ @EventListener
+ void processTopEvent(TopEvent topEvent);
}
diff --git a/juick-common/src/main/java/com/juick/service/component/TopEvent.java b/juick-common/src/main/java/com/juick/service/component/TopEvent.java
new file mode 100644
index 00000000..b7e24957
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/service/component/TopEvent.java
@@ -0,0 +1,21 @@
+package com.juick.service.component;
+
+import com.juick.Message;
+import org.springframework.context.ApplicationEvent;
+
+public class TopEvent extends ApplicationEvent {
+ private Message message;
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public TopEvent(Object source, Message message) {
+ super(source);
+ this.message = message;
+ }
+
+ public Message getMessage() {
+ return message;
+ }
+}