diff options
Diffstat (limited to 'juick-common/src/main/java/com/juick/server/component')
-rw-r--r-- | juick-common/src/main/java/com/juick/server/component/LikeEvent.java | 10 | ||||
-rw-r--r-- | juick-common/src/main/java/com/juick/server/component/MessageEvent.java | 11 |
2 files changed, 19 insertions, 2 deletions
diff --git a/juick-common/src/main/java/com/juick/server/component/LikeEvent.java b/juick-common/src/main/java/com/juick/server/component/LikeEvent.java index 8ff0a184a..678a84a9a 100644 --- a/juick-common/src/main/java/com/juick/server/component/LikeEvent.java +++ b/juick-common/src/main/java/com/juick/server/component/LikeEvent.java @@ -4,18 +4,22 @@ import com.juick.Message; import com.juick.User; import org.springframework.context.ApplicationEvent; +import java.util.List; + public class LikeEvent extends ApplicationEvent { private User user; private Message message; + private List<User> subscribers; /** * Create a new ApplicationEvent. * * @param source the object on which the event initially occurred (never {@code null}) */ - public LikeEvent(Object source, User user, Message message) { + public LikeEvent(Object source, User user, Message message, List<User> subscribers) { super(source); this.message = message; this.user = user; + this.subscribers = subscribers; } public User getUser() { @@ -25,4 +29,8 @@ public class LikeEvent extends ApplicationEvent { public Message getMessage() { return message; } + + public List<User> getSubscribers() { + return subscribers; + } } diff --git a/juick-common/src/main/java/com/juick/server/component/MessageEvent.java b/juick-common/src/main/java/com/juick/server/component/MessageEvent.java index 048de6a6e..c0c602280 100644 --- a/juick-common/src/main/java/com/juick/server/component/MessageEvent.java +++ b/juick-common/src/main/java/com/juick/server/component/MessageEvent.java @@ -1,22 +1,31 @@ package com.juick.server.component; import com.juick.Message; +import com.juick.User; import org.springframework.context.ApplicationEvent; +import java.util.List; + public class MessageEvent extends ApplicationEvent { private Message message; + private List<User> users; /** * Create a new ApplicationEvent. * * @param source the object on which the event initially occurred (never {@code null}) * @param message app message + * @param interestedUsers users interested in notification */ - public MessageEvent(Object source, Message message) { + public MessageEvent(Object source, Message message, List<User> interestedUsers) { super(source); this.message = message; + this.users = interestedUsers; } public Message getMessage() { return message; } + public List<User> getUsers() { + return users; + } } |