added needed fields in models and needed libraries for frontend (#67)

This commit is contained in:
Athou
2013-06-01 21:00:10 +02:00
parent 33eb99b8c6
commit 7ffd044a86
11 changed files with 195 additions and 67 deletions

View File

@@ -8,19 +8,36 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.collect.Lists;
import com.wordnik.swagger.annotations.ApiClass;
import com.wordnik.swagger.annotations.ApiProperty;
@SuppressWarnings("serial")
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@ApiClass("Entry details")
public class Category implements Serializable {
@ApiProperty("category id")
private String id;
@ApiProperty("parent category id")
private String parentId;
@ApiProperty("category id")
private String name;
@ApiProperty("category children categories")
private List<Category> children = Lists.newArrayList();
@ApiProperty("category feeds")
private List<Subscription> feeds = Lists.newArrayList();
@ApiProperty("wether the category is expanded or collapsed")
private boolean expanded;
@ApiProperty("position of the category in the list")
private Integer position;
public String getId() {
return id;
}
@@ -68,4 +85,13 @@ public class Category implements Serializable {
public void setExpanded(boolean expanded) {
this.expanded = expanded;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
}

View File

@@ -29,6 +29,7 @@ public class Subscription implements Serializable {
Subscription sub = new Subscription();
sub.setId(subscription.getId());
sub.setName(subscription.getTitle());
sub.setPosition(subscription.getPosition());
sub.setMessage(feed.getMessage());
sub.setErrorCount(feed.getErrorCount());
sub.setFeedUrl(feed.getUrl());
@@ -77,6 +78,9 @@ public class Subscription implements Serializable {
@ApiProperty(value = "category id")
private String categoryId;
@ApiProperty("position of the subscription's in the list")
private Integer position;
public Long getId() {
return id;
}
@@ -165,4 +169,12 @@ public class Subscription implements Serializable {
this.iconUrl = iconUrl;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
}