send date of the newest subscriptions item

This commit is contained in:
Athou
2013-08-08 17:00:35 +02:00
parent 74ee810757
commit 474995c8dd
9 changed files with 65 additions and 40 deletions

View File

@@ -20,7 +20,7 @@ import com.wordnik.swagger.annotations.ApiProperty;
@ApiClass("User information")
public class Subscription implements Serializable {
public static Subscription build(FeedSubscription subscription, String publicUrl, long unreadCount) {
public static Subscription build(FeedSubscription subscription, String publicUrl, UnreadCount unreadCount) {
Date now = new Date();
FeedCategory category = subscription.getCategory();
Feed feed = subscription.getFeed();
@@ -35,7 +35,8 @@ public class Subscription implements Serializable {
sub.setIconUrl(FeedUtils.getFaviconUrl(subscription, publicUrl));
sub.setLastRefresh(feed.getLastUpdated());
sub.setNextRefresh((feed.getDisabledUntil() != null && feed.getDisabledUntil().before(now)) ? null : feed.getDisabledUntil());
sub.setUnread(unreadCount);
sub.setUnread(unreadCount.getUnreadCount());
sub.setNewestItemTime(unreadCount.getNewestItemTime());
sub.setCategoryId(category == null ? null : String.valueOf(category.getId()));
return sub;
}
@@ -76,6 +77,9 @@ public class Subscription implements Serializable {
@ApiProperty("position of the subscription's in the list")
private Integer position;
@ApiProperty("date of the newest item")
private Date newestItemTime;
public Long getId() {
return id;
}
@@ -172,4 +176,12 @@ public class Subscription implements Serializable {
this.position = position;
}
public Date getNewestItemTime() {
return newestItemTime;
}
public void setNewestItemTime(Date newestItemTime) {
this.newestItemTime = newestItemTime;
}
}