From 2c1bfab10903895ece9644bc095597aaef2a75e8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 14 Aug 2018 13:23:53 +0300 Subject: Message editing API --- juick-common/src/main/java/com/juick/Message.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'juick-common/src/main/java/com/juick/Message.java') diff --git a/juick-common/src/main/java/com/juick/Message.java b/juick-common/src/main/java/com/juick/Message.java index 3800f466..212cb2fa 100644 --- a/juick-common/src/main/java/com/juick/Message.java +++ b/juick-common/src/main/java/com/juick/Message.java @@ -46,6 +46,7 @@ public class Message implements Comparable { private final List tags; private Instant ts; private Instant updated; + private Instant updatedAt; private boolean unread; @JsonIgnore private int privacy = 1; @@ -281,6 +282,9 @@ public class Message implements Comparable { this.attachment = attachment; } + /** + * @return timestamp of the last comment + */ @XmlTransient public Instant getUpdated() { return updated; @@ -329,4 +333,18 @@ public class Message implements Comparable { public void setRecommendations(Set recommendations) { this.recommendations = recommendations; } + + /** + * @return timestamp of the last edit + */ + @XmlTransient + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC") + @JsonProperty("updated_at") + public Instant getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Instant updatedAt) { + this.updatedAt = updatedAt; + } } -- cgit v1.2.3