diff options
author | Vitaly Takmazov | 2018-09-25 12:49:57 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-25 12:49:57 +0300 |
commit | 15753b2ebdac2ab49cf5682c417851a0653e136e (patch) | |
tree | 81efc43348a820a1c647779f78264bce10103b59 /juick-common | |
parent | ae76024011a8442ae7eab953e0b97e9fe2c7c201 (diff) |
notifications server refactoring
Diffstat (limited to 'juick-common')
-rw-r--r-- | juick-common/src/main/java/com/juick/service/component/MessageReadEvent.java | 12 | ||||
-rw-r--r-- | juick-common/src/main/java/com/juick/service/component/NotificationListener.java | 16 |
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); +} |