aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-25 12:49:57 +0300
committerGravatar Vitaly Takmazov2018-09-25 12:49:57 +0300
commit15753b2ebdac2ab49cf5682c417851a0653e136e (patch)
tree81efc43348a820a1c647779f78264bce10103b59 /juick-common/src
parentae76024011a8442ae7eab953e0b97e9fe2c7c201 (diff)
notifications server refactoring
Diffstat (limited to 'juick-common/src')
-rw-r--r--juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java12
-rw-r--r--juick-common/src/main/java/com/juick/service/component/NotificationListener.java16
2 files changed, 23 insertions, 5 deletions
diff --git a/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java b/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java
index 82cfadd5..b314b89b 100644
--- a/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java
+++ b/juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java
@@ -4,22 +4,24 @@ import com.juick.Message;
import com.juick.User;
import org.springframework.context.ApplicationEvent;
+import java.util.List;
+
public class MessageReadEvent extends ApplicationEvent {
- private User user;
+ private List<User> users;
private Message message;
/**
* Create a new ApplicationEvent.
*
* @param source the object on which the event initially occurred (never {@code null})
*/
- public MessageReadEvent(Object source, User user, Message message) {
+ public MessageReadEvent(Object source, List<User> users, Message message) {
super(source);
- this.user = user;
+ this.users = users;
this.message = message;
}
- public User getUser() {
- return user;
+ public List<User> getUsers() {
+ return users;
}
public Message getMessage() {
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
new file mode 100644
index 00000000..e4ccb13b
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/service/component/NotificationListener.java
@@ -0,0 +1,16 @@
+package com.juick.service.component;
+
+import org.springframework.context.event.EventListener;
+
+public interface NotificationListener {
+ @EventListener
+ void processMessageEvent(MessageEvent messageEvent);
+ @EventListener
+ void processSubscribeEvent(SubscribeEvent subscribeEvent);
+ @EventListener
+ void processLikeEvent(LikeEvent likeEvent);
+ @EventListener
+ void processPingEvent(PingEvent pingEvent);
+ @EventListener
+ void processMessageReadEvent(MessageReadEvent messageReadEvent);
+}