diff options
author | 2016-11-30 16:49:11 +0300 | |
---|---|---|
committer | 2016-11-30 16:49:11 +0300 | |
commit | 1a2830588131173d8fbfeb1fe03c466b4cf30e46 (patch) | |
tree | 53889640b356f22e6620acffed0bda1e56babcf6 /juick-core/src/main/java/com/juick/Message.java | |
parent | f5fd9c7bea380eb4c0c2d58f2167ad3f07c45c33 (diff) |
juick-core: fix attachment serialization
Diffstat (limited to 'juick-core/src/main/java/com/juick/Message.java')
-rw-r--r-- | juick-core/src/main/java/com/juick/Message.java | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/juick-core/src/main/java/com/juick/Message.java b/juick-core/src/main/java/com/juick/Message.java index b5fc2b89..d3f28e22 100644 --- a/juick-core/src/main/java/com/juick/Message.java +++ b/juick-core/src/main/java/com/juick/Message.java @@ -57,9 +57,9 @@ public class Message implements Comparable { @XmlTransient public int Replies = 0; public String RepliesBy = null; + private String attachmentType; @XmlTransient - public String AttachmentType = null; - public String Photo = null; + private Photo photo; public String Video = null; public Place Place = null; @XmlTransient @@ -87,8 +87,8 @@ public class Message implements Comparable { ReadOnly = msg.ReadOnly; Hidden = msg.Hidden; Replies = msg.Replies; - AttachmentType = msg.AttachmentType; - Photo = msg.Photo; + attachmentType = msg.attachmentType; + photo = msg.photo; Video = msg.Video; Place = msg.Place; Likes = msg.Likes; @@ -157,15 +157,16 @@ public class Message implements Comparable { } } + @JsonIgnore public String getAttachmentURL() { - if (AttachmentType != null) { + if (attachmentType != null) { String url = "http://i.juick.com/"; - url += AttachmentType.equals("mp4") ? "video" : "photos-1024"; + url += attachmentType.equals("mp4") ? "video" : "photos-1024"; url += "/" + getMid(); if (getRid() > 0) { url += "-" + getRid(); } - url += "." + AttachmentType; + url += "." + attachmentType; return url; } else { return null; @@ -309,4 +310,22 @@ public class Message implements Comparable { public void setPrivacy(int privacy) { this.privacy = privacy; } + + public Photo getPhoto() { + return photo; + } + + public void setPhoto(Photo photo) { + this.photo = photo; + } + + @XmlAttribute(name = "attach") + @JsonProperty("attach") + public String getAttachmentType() { + return attachmentType; + } + + public void setAttachmentType(String attachmentType) { + this.attachmentType = attachmentType; + } } |