display next refresh date

This commit is contained in:
Athou
2013-05-22 16:10:50 +02:00
parent 97c2c12fe2
commit 0fdb714641
4 changed files with 33 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedSubscription;
import com.wordnik.swagger.annotations.ApiClass;
@@ -21,14 +22,16 @@ public class Subscription implements Serializable {
public static Subscription build(FeedSubscription subscription,
long unreadCount) {
FeedCategory category = subscription.getCategory();
Feed feed = subscription.getFeed();
Subscription sub = new Subscription();
sub.setId(subscription.getId());
sub.setName(subscription.getTitle());
sub.setMessage(subscription.getFeed().getMessage());
sub.setErrorCount(subscription.getFeed().getErrorCount());
sub.setFeedUrl(subscription.getFeed().getUrl());
sub.setFeedLink(subscription.getFeed().getLink());
sub.setLastRefresh(subscription.getFeed().getLastUpdated());
sub.setMessage(feed.getMessage());
sub.setErrorCount(feed.getErrorCount());
sub.setFeedUrl(feed.getUrl());
sub.setFeedLink(feed.getLink());
sub.setLastRefresh(feed.getLastUpdated());
sub.setNextRefresh(feed.getDisabledUntil());
sub.setUnread(unreadCount);
sub.setCategoryId(category == null ? null : String.valueOf(category
.getId()));
@@ -50,6 +53,9 @@ public class Subscription implements Serializable {
@ApiProperty(value = "last time the feed was refreshed", required = true)
private Date lastRefresh;
@ApiProperty(value = "next time the feed refresh is planned", required = true)
private Date nextRefresh;
@ApiProperty(value = "this subscription's feed url", required = true)
private String feedUrl;
@@ -134,4 +140,12 @@ public class Subscription implements Serializable {
this.categoryId = categoryId;
}
public Date getNextRefresh() {
return nextRefresh;
}
public void setNextRefresh(Date nextRefresh) {
this.nextRefresh = nextRefresh;
}
}