aboutsummaryrefslogtreecommitdiff
path: root/juick-common
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common')
-rw-r--r--juick-common/src/main/java/com/juick/Chat.java24
-rw-r--r--juick-common/src/main/java/com/juick/User.java1
-rw-r--r--juick-common/src/main/java/com/juick/model/PrivateChats.java8
-rw-r--r--juick-common/src/main/java/com/juick/service/PMQueriesService.java3
4 files changed, 30 insertions, 6 deletions
diff --git a/juick-common/src/main/java/com/juick/Chat.java b/juick-common/src/main/java/com/juick/Chat.java
new file mode 100644
index 00000000..c4f105dc
--- /dev/null
+++ b/juick-common/src/main/java/com/juick/Chat.java
@@ -0,0 +1,24 @@
+package com.juick;
+
+import java.time.Instant;
+
+public class Chat extends User {
+ private Instant lastMessageTimestamp;
+ private String lastMessageText;
+
+ public Instant getLastMessageTimestamp() {
+ return lastMessageTimestamp;
+ }
+
+ public void setLastMessageTimestamp(Instant lastMessageTimestamp) {
+ this.lastMessageTimestamp = lastMessageTimestamp;
+ }
+
+ public String getLastMessageText() {
+ return lastMessageText;
+ }
+
+ public void setLastMessageText(String lastMessageText) {
+ this.lastMessageText = lastMessageText;
+ }
+}
diff --git a/juick-common/src/main/java/com/juick/User.java b/juick-common/src/main/java/com/juick/User.java
index 8228230d..765b5abb 100644
--- a/juick-common/src/main/java/com/juick/User.java
+++ b/juick-common/src/main/java/com/juick/User.java
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
-import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
diff --git a/juick-common/src/main/java/com/juick/model/PrivateChats.java b/juick-common/src/main/java/com/juick/model/PrivateChats.java
index ad04e649..b6bb48ab 100644
--- a/juick-common/src/main/java/com/juick/model/PrivateChats.java
+++ b/juick-common/src/main/java/com/juick/model/PrivateChats.java
@@ -18,7 +18,7 @@
package com.juick.model;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.juick.User;
+import com.juick.Chat;
import java.util.List;
@@ -26,14 +26,14 @@ import java.util.List;
* Created by vt on 24/11/2016.
*/
public class PrivateChats {
- private List<User> users;
+ private List<Chat> users;
@JsonProperty("pms")
- public List<User> getUsers() {
+ public List<Chat> getUsers() {
return users;
}
- public void setUsers(List<User> users) {
+ public void setUsers(List<Chat> users) {
this.users = users;
}
}
diff --git a/juick-common/src/main/java/com/juick/service/PMQueriesService.java b/juick-common/src/main/java/com/juick/service/PMQueriesService.java
index 4c70eece..d9e1f18f 100644
--- a/juick-common/src/main/java/com/juick/service/PMQueriesService.java
+++ b/juick-common/src/main/java/com/juick/service/PMQueriesService.java
@@ -17,6 +17,7 @@
package com.juick.service;
+import com.juick.Chat;
import com.juick.User;
import java.util.List;
@@ -35,7 +36,7 @@ public interface PMQueriesService {
String getLastView(int uidFrom, int uidTo);
- List<User> getPMLastConversationsUsers(int uid, int cnt);
+ List<Chat> getLastChats(User user);
List<com.juick.Message> getPMMessages(int uid, int uidTo);