diff options
Diffstat (limited to 'juick-common/src')
-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); +} |