package refactoring

This commit is contained in:
Athou
2013-03-23 16:17:19 +01:00
parent 7067646b2d
commit 4df1e7f722
36 changed files with 60 additions and 56 deletions

View File

@@ -5,6 +5,8 @@ import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import com.commafeed.frontend.rest.resources.EntriesREST;
import com.commafeed.frontend.rest.resources.SubscriptionsREST;
import com.google.common.collect.Sets;
@ApplicationPath("/rest")

View File

@@ -1,47 +0,0 @@
package com.commafeed.frontend.rest.model;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Category implements Serializable {
private String id;
private String name;
private List<Category> children = Lists.newArrayList();
private List<Subscription> feeds = Lists.newArrayList();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Category> getChildren() {
return children;
}
public void setChildren(List<Category> children) {
this.children = children;
}
public List<Subscription> getFeeds() {
return feeds;
}
public void setFeeds(List<Subscription> feeds) {
this.feeds = feeds;
}
}

View File

@@ -1,28 +0,0 @@
package com.commafeed.frontend.rest.model;
import java.io.Serializable;
import java.util.List;
import com.google.common.collect.Lists;
public class Entries implements Serializable {
private String name;
private List<Entry> entries = Lists.newArrayList();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Entry> getEntries() {
return entries;
}
public void setEntries(List<Entry> entries) {
this.entries = entries;
}
}

View File

@@ -1,90 +0,0 @@
package com.commafeed.frontend.rest.model;
import java.io.Serializable;
import java.util.Date;
public class Entry implements Serializable {
private String id;
private String title;
private String content;
private Date date;
private String feedId;
private String feedName;
private String url;
private boolean read;
private boolean starred;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getFeedId() {
return feedId;
}
public void setFeedId(String feedId) {
this.feedId = feedId;
}
public String getFeedName() {
return feedName;
}
public void setFeedName(String feedName) {
this.feedName = feedName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public boolean isRead() {
return read;
}
public void setRead(boolean read) {
this.read = read;
}
public boolean isStarred() {
return starred;
}
public void setStarred(boolean starred) {
this.starred = starred;
}
}

View File

@@ -1,35 +0,0 @@
package com.commafeed.frontend.rest.model;
import java.io.Serializable;
public class Subscription implements Serializable {
private Long id;
private String name;
private int unread;
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 int getUnread() {
return unread;
}
public void setUnread(int unread) {
this.unread = unread;
}
}

View File

@@ -1,4 +1,4 @@
package com.commafeed.frontend.rest;
package com.commafeed.frontend.rest.resources;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
@@ -18,8 +18,8 @@ import com.commafeed.backend.dao.FeedCategoryService;
import com.commafeed.backend.dao.FeedEntryService;
import com.commafeed.backend.dao.FeedEntryStatusService;
import com.commafeed.backend.dao.FeedSubscriptionService;
import com.commafeed.backend.model.User;
import com.commafeed.frontend.CommaFeedSession;
import com.commafeed.model.User;
@Produces(MediaType.APPLICATION_JSON)
public abstract class AbstractREST {

View File

@@ -1,4 +1,4 @@
package com.commafeed.frontend.rest;
package com.commafeed.frontend.rest.resources;
import java.util.Collection;
import java.util.Collections;
@@ -11,13 +11,13 @@ import javax.ws.rs.PathParam;
import org.apache.commons.lang.ObjectUtils;
import com.commafeed.frontend.rest.model.Entries;
import com.commafeed.frontend.rest.model.Entry;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedEntry;
import com.commafeed.backend.model.FeedEntryStatus;
import com.commafeed.backend.model.FeedSubscription;
import com.commafeed.frontend.model.Entries;
import com.commafeed.frontend.model.Entry;
import com.commafeed.frontend.utils.ModelFactory.MF;
import com.commafeed.model.FeedCategory;
import com.commafeed.model.FeedEntry;
import com.commafeed.model.FeedEntryStatus;
import com.commafeed.model.FeedSubscription;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

View File

@@ -1,4 +1,4 @@
package com.commafeed.frontend.rest;
package com.commafeed.frontend.rest.resources;
import java.util.List;
@@ -7,10 +7,10 @@ import javax.ws.rs.Path;
import org.apache.commons.lang.ObjectUtils;
import com.commafeed.frontend.rest.model.Category;
import com.commafeed.frontend.rest.model.Subscription;
import com.commafeed.model.FeedCategory;
import com.commafeed.model.FeedSubscription;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedSubscription;
import com.commafeed.frontend.model.Category;
import com.commafeed.frontend.model.Subscription;
@Path("subscriptions")
public class SubscriptionsREST extends AbstractREST {