mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
smarter queries for other types
This commit is contained in:
@@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import com.commafeed.backend.feeds.FeedUtils;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedEntryStatus;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.sun.syndication.feed.synd.SyndContentImpl;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndEntryImpl;
|
||||
@@ -27,28 +28,28 @@ public class Entry implements Serializable {
|
||||
Entry entry = new Entry();
|
||||
|
||||
FeedEntry feedEntry = status.getEntry();
|
||||
entry.setId(String.valueOf(status.getId()));
|
||||
FeedSubscription sub = status.getSubscription();
|
||||
|
||||
entry.setRead(status.isRead());
|
||||
entry.setStarred(status.isStarred());
|
||||
|
||||
entry.setId(String.valueOf(feedEntry.getId()));
|
||||
entry.setGuid(feedEntry.getGuid());
|
||||
entry.setTitle(feedEntry.getContent().getTitle());
|
||||
entry.setContent(feedEntry.getContent().getContent());
|
||||
entry.setRtl(FeedUtils.isRTL(feedEntry));
|
||||
entry.setAuthor(feedEntry.getAuthor());
|
||||
entry.setEnclosureUrl(status.getEntry().getContent().getEnclosureUrl());
|
||||
entry.setEnclosureType(status.getEntry().getContent()
|
||||
.getEnclosureType());
|
||||
entry.setEnclosureUrl(feedEntry.getContent().getEnclosureUrl());
|
||||
entry.setEnclosureType(feedEntry.getContent().getEnclosureType());
|
||||
entry.setDate(feedEntry.getUpdated());
|
||||
entry.setInsertedDate(feedEntry.getInserted());
|
||||
entry.setUrl(feedEntry.getUrl());
|
||||
|
||||
entry.setRead(status.isRead());
|
||||
entry.setStarred(status.isStarred());
|
||||
|
||||
entry.setFeedName(status.getSubscription().getTitle());
|
||||
entry.setFeedId(String.valueOf(status.getSubscription().getId()));
|
||||
entry.setFeedUrl(status.getSubscription().getFeed().getUrl());
|
||||
entry.setFeedLink(status.getSubscription().getFeed().getLink());
|
||||
entry.setIconUrl(FeedUtils.getFaviconUrl(status.getSubscription(),
|
||||
publicUrl));
|
||||
entry.setFeedName(sub.getTitle());
|
||||
entry.setFeedId(String.valueOf(sub.getId()));
|
||||
entry.setFeedUrl(sub.getFeed().getUrl());
|
||||
entry.setFeedLink(sub.getFeed().getLink());
|
||||
entry.setIconUrl(FeedUtils.getFaviconUrl(sub, publicUrl));
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -15,9 +15,12 @@ import com.wordnik.swagger.annotations.ApiProperty;
|
||||
@ApiClass("Mark Request")
|
||||
public class MarkRequest implements Serializable {
|
||||
|
||||
@ApiProperty(value = "id", required = true)
|
||||
@ApiProperty(value = "entry id, category id, 'all' or 'starred'", required = true)
|
||||
private String id;
|
||||
|
||||
@ApiProperty(value = "feed id, only required when marking an entry")
|
||||
private Long feedId;
|
||||
|
||||
@ApiProperty(value = "mark as read or unread")
|
||||
private boolean read;
|
||||
|
||||
@@ -48,4 +51,12 @@ public class MarkRequest implements Serializable {
|
||||
this.olderThan = olderThan;
|
||||
}
|
||||
|
||||
public Long getFeedId() {
|
||||
return feedId;
|
||||
}
|
||||
|
||||
public void setFeedId(Long feedId) {
|
||||
this.feedId = feedId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ public class StarRequest implements Serializable {
|
||||
@ApiProperty(value = "id", required = true)
|
||||
private String id;
|
||||
|
||||
@ApiProperty(value = "feed id", required = true)
|
||||
private Long feedId;
|
||||
|
||||
@ApiProperty(value = "starred or not")
|
||||
private boolean starred;
|
||||
|
||||
@@ -37,4 +40,12 @@ public class StarRequest implements Serializable {
|
||||
this.starred = starred;
|
||||
}
|
||||
|
||||
public Long getFeedId() {
|
||||
return feedId;
|
||||
}
|
||||
|
||||
public void setFeedId(Long feedId) {
|
||||
this.feedId = feedId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user