From 8e83a22012c2bee323eeeb3ae1384ac488741ebf Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 23 Oct 2018 17:48:25 +0300 Subject: Last seen --- juick-common/src/main/java/com/juick/User.java | 10 ++++++++++ juick-common/src/main/java/com/juick/service/UserService.java | 3 +++ 2 files changed, 13 insertions(+) (limited to 'juick-common/src/main/java/com/juick') diff --git a/juick-common/src/main/java/com/juick/User.java b/juick-common/src/main/java/com/juick/User.java index 765b5abb..ca907987 100644 --- a/juick-common/src/main/java/com/juick/User.java +++ b/juick-common/src/main/java/com/juick/User.java @@ -27,6 +27,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import java.net.URI; +import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -50,6 +51,7 @@ public class User { private List readers; private List unread; private URI uri; + private Instant seen; public User() { tokens = new ArrayList<>(); @@ -209,4 +211,12 @@ public class User { public void setUri(URI uri) { this.uri = uri; } + + public Instant getSeen() { + return seen; + } + + public void setSeen(Instant seen) { + this.seen = seen; + } } diff --git a/juick-common/src/main/java/com/juick/service/UserService.java b/juick-common/src/main/java/com/juick/service/UserService.java index d59f71ef..832f978a 100644 --- a/juick-common/src/main/java/com/juick/service/UserService.java +++ b/juick-common/src/main/java/com/juick/service/UserService.java @@ -23,6 +23,7 @@ import com.juick.model.Auth; import com.juick.model.UserInfo; import javax.annotation.Nonnull; +import java.time.Instant; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -131,4 +132,6 @@ public interface UserService { boolean unauthJID(int uid, String jid); List getActiveJIDs(); + + void updateLastSeen(User user); } -- cgit v1.2.3