mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
refactored tree, no more dropdown for feed editing
This commit is contained in:
@@ -15,6 +15,7 @@ import com.google.common.collect.Lists;
|
||||
public class Category implements Serializable {
|
||||
|
||||
private String id;
|
||||
private String parentId;
|
||||
private String name;
|
||||
private List<Category> children = Lists.newArrayList();
|
||||
private List<Subscription> feeds = Lists.newArrayList();
|
||||
@@ -28,6 +29,14 @@ public class Category implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ public class Entry implements Serializable {
|
||||
|
||||
entry.setFeedName(status.getSubscription().getTitle());
|
||||
entry.setFeedId(String.valueOf(status.getSubscription().getId()));
|
||||
entry.setFeedUrl(status.getSubscription().getFeed().getLink());
|
||||
entry.setFeedUrl(status.getSubscription().getFeed().getUrl());
|
||||
entry.setFeedLink(status.getSubscription().getFeed().getLink());
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -87,9 +88,12 @@ public class Entry implements Serializable {
|
||||
@ApiProperty("feed name")
|
||||
private String feedName;
|
||||
|
||||
@ApiProperty("feed url")
|
||||
@ApiProperty("this entry's feed url")
|
||||
private String feedUrl;
|
||||
|
||||
@ApiProperty("this entry's website url")
|
||||
private String feedLink;
|
||||
|
||||
@ApiProperty("entry url")
|
||||
private String url;
|
||||
|
||||
@@ -203,4 +207,12 @@ public class Entry implements Serializable {
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getFeedLink() {
|
||||
return feedLink;
|
||||
}
|
||||
|
||||
public void setFeedLink(String feedLink) {
|
||||
this.feedLink = feedLink;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.wordnik.swagger.annotations.ApiClass;
|
||||
import com.wordnik.swagger.annotations.ApiProperty;
|
||||
|
||||
@@ -15,6 +18,23 @@ import com.wordnik.swagger.annotations.ApiProperty;
|
||||
@ApiClass("User information")
|
||||
public class Subscription implements Serializable {
|
||||
|
||||
public static Subscription build(FeedSubscription subscription,
|
||||
long unreadCount) {
|
||||
FeedCategory category = subscription.getCategory();
|
||||
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.setUnread(unreadCount);
|
||||
sub.setCategoryId(category == null ? null : String.valueOf(category
|
||||
.getId()));
|
||||
return sub;
|
||||
}
|
||||
|
||||
@ApiProperty(value = "subscription id", required = true)
|
||||
private Long id;
|
||||
|
||||
@@ -27,12 +47,21 @@ public class Subscription implements Serializable {
|
||||
@ApiProperty(value = "error count", required = true)
|
||||
private int errorCount;
|
||||
|
||||
@ApiProperty(value = "last time the feed was refreshed", required = true)
|
||||
private Date lastRefresh;
|
||||
|
||||
@ApiProperty(value = "this subscription's feed url", required = true)
|
||||
private String feedUrl;
|
||||
|
||||
@ApiProperty(value = "this subscription's website url", required = true)
|
||||
private String feedLink;
|
||||
|
||||
@ApiProperty(value = "unread count", required = true)
|
||||
private long unread;
|
||||
|
||||
@ApiProperty(value = "category id")
|
||||
private String categoryId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -81,4 +110,28 @@ public class Subscription implements Serializable {
|
||||
this.errorCount = errorCount;
|
||||
}
|
||||
|
||||
public String getFeedLink() {
|
||||
return feedLink;
|
||||
}
|
||||
|
||||
public void setFeedLink(String feedLink) {
|
||||
this.feedLink = feedLink;
|
||||
}
|
||||
|
||||
public Date getLastRefresh() {
|
||||
return lastRefresh;
|
||||
}
|
||||
|
||||
public void setLastRefresh(Date lastRefresh) {
|
||||
this.lastRefresh = lastRefresh;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,15 +12,18 @@ import com.wordnik.swagger.annotations.ApiProperty;
|
||||
@SuppressWarnings("serial")
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@ApiClass("Rename Request")
|
||||
public class RenameRequest implements Serializable {
|
||||
@ApiClass("Category modification request")
|
||||
public class CategoryModificationRequest implements Serializable {
|
||||
|
||||
@ApiProperty(value = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiProperty(value = "mark as read or unread")
|
||||
@ApiProperty(value = "new name")
|
||||
private String name;
|
||||
|
||||
@ApiProperty(value = "new parent category id")
|
||||
private String parentId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -37,4 +40,12 @@ public class RenameRequest implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.wordnik.swagger.annotations.ApiClass;
|
||||
import com.wordnik.swagger.annotations.ApiProperty;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@ApiClass("Feed modification request")
|
||||
public class FeedModificationRequest implements Serializable {
|
||||
|
||||
@ApiProperty(value = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiProperty(value = "new name")
|
||||
private String name;
|
||||
|
||||
@ApiProperty(value = "new parent category id")
|
||||
private String categoryId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user