aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/server/component
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-21 12:20:56 +0300
committerGravatar Vitaly Takmazov2018-03-21 13:52:55 +0300
commit403fab0c39e99ffd0b386eb612f3574938ae2125 (patch)
tree47b99c53134468da50c6f766ebb16043fa984cfa /juick-common/src/main/java/com/juick/server/component
parentf066f48e4cabd0d7649af2e8c1f4b6a7dea56673 (diff)
add some events
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.java28
-rw-r--r--juick-common/src/main/java/com/juick/server/component/SubscribeEvent.java27
2 files changed, 55 insertions, 0 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
new file mode 100644
index 00000000..8ff0a184
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/server/component/LikeEvent.java
@@ -0,0 +1,28 @@
+package com.juick.server.component;
+
+import com.juick.Message;
+import com.juick.User;
+import org.springframework.context.ApplicationEvent;
+
+public class LikeEvent extends ApplicationEvent {
+ private User user;
+ private Message message;
+ /**
+ * 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) {
+ super(source);
+ this.message = message;
+ this.user = user;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public Message getMessage() {
+ return message;
+ }
+}
diff --git a/juick-common/src/main/java/com/juick/server/component/SubscribeEvent.java b/juick-common/src/main/java/com/juick/server/component/SubscribeEvent.java
new file mode 100644
index 00000000..2d3ceddb
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/server/component/SubscribeEvent.java
@@ -0,0 +1,27 @@
+package com.juick.server.component;
+
+import com.juick.User;
+import org.springframework.context.ApplicationEvent;
+
+public class SubscribeEvent extends ApplicationEvent {
+ private User user;
+ private User toUser;
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public SubscribeEvent(Object source, User user, User toUser) {
+ super(source);
+ this.user = user;
+ this.toUser = toUser;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public User getToUser() {
+ return toUser;
+ }
+}