mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
use jax rs instead of wicket for rest api
This commit is contained in:
@@ -46,4 +46,13 @@ public class FeedEntryService extends GenericDAO<FeedEntry, Long> {
|
|||||||
return typedQuery.getResultList();
|
return typedQuery.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<FeedEntry> getAllEntries(Feed feed, User user) {
|
||||||
|
String query = "select e from FeedEntry e where e.feed=:feed";
|
||||||
|
TypedQuery<FeedEntry> typedQuery = em.createQuery(query,
|
||||||
|
FeedEntry.class);
|
||||||
|
typedQuery.setParameter("feed", feed);
|
||||||
|
typedQuery.setParameter("user", user);
|
||||||
|
return typedQuery.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class FeedParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String handleContent(String content) {
|
private String handleContent(String content) {
|
||||||
Document doc = Jsoup.parse(content);
|
Document doc = Jsoup.parse(content, "UTF-8");
|
||||||
doc.select("a").attr("target", "_blank");
|
doc.select("a").attr("target", "_blank");
|
||||||
return doc.outerHtml();
|
return doc.outerHtml();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
import com.commafeed.frontend.components.auth.LoginPage;
|
import com.commafeed.frontend.components.auth.LoginPage;
|
||||||
import com.commafeed.frontend.components.auth.LogoutPage;
|
import com.commafeed.frontend.components.auth.LogoutPage;
|
||||||
import com.commafeed.frontend.pages.home.HomePage;
|
import com.commafeed.frontend.pages.home.HomePage;
|
||||||
import com.commafeed.frontend.rest.FeedEntriesREST;
|
|
||||||
import com.commafeed.frontend.rest.FeedSubscriptionsREST;
|
|
||||||
import com.commafeed.frontend.utils.exception.DisplayExceptionPage;
|
import com.commafeed.frontend.utils.exception.DisplayExceptionPage;
|
||||||
|
|
||||||
public class CommaFeedApplication extends AuthenticatedWebApplication {
|
public class CommaFeedApplication extends AuthenticatedWebApplication {
|
||||||
@@ -45,11 +43,6 @@ public class CommaFeedApplication extends AuthenticatedWebApplication {
|
|||||||
mountPage("logout", LogoutPage.class);
|
mountPage("logout", LogoutPage.class);
|
||||||
mountPage("error", DisplayExceptionPage.class);
|
mountPage("error", DisplayExceptionPage.class);
|
||||||
|
|
||||||
mountPage("subscriptions", FeedSubscriptionsREST.class);
|
|
||||||
mountPage(String.format("entries/${%s}/${%s}/${%s}",
|
|
||||||
FeedEntriesREST.PARAM_TYPE, FeedEntriesREST.PARAM_ID,
|
|
||||||
FeedEntriesREST.PARAM_READTYPE), FeedEntriesREST.class);
|
|
||||||
|
|
||||||
setupInjection();
|
setupInjection();
|
||||||
|
|
||||||
getMarkupSettings().setStripWicketTags(true);
|
getMarkupSettings().setStripWicketTags(true);
|
||||||
|
|||||||
60
src/main/java/com/commafeed/frontend/rest/AbstractREST.java
Normal file
60
src/main/java/com/commafeed/frontend/rest/AbstractREST.java
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
package com.commafeed.frontend.rest;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
import org.apache.wicket.Application;
|
||||||
|
import org.apache.wicket.ThreadContext;
|
||||||
|
import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
|
||||||
|
import org.apache.wicket.protocol.http.servlet.ServletWebResponse;
|
||||||
|
import org.apache.wicket.request.cycle.RequestCycle;
|
||||||
|
|
||||||
|
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.frontend.CommaFeedSession;
|
||||||
|
import com.commafeed.model.User;
|
||||||
|
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public abstract class AbstractREST {
|
||||||
|
|
||||||
|
@Context
|
||||||
|
HttpServletRequest request;
|
||||||
|
|
||||||
|
@Context
|
||||||
|
HttpServletResponse response;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
FeedSubscriptionService feedSubscriptionService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
FeedCategoryService feedCategoryService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
FeedEntryService feedEntryService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
FeedEntryStatusService feedEntryStatusService;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
ServletWebRequest swreq = new ServletWebRequest(request, "");
|
||||||
|
ServletWebResponse swresp = new ServletWebResponse(swreq, response);
|
||||||
|
RequestCycle cycle = Application.get()
|
||||||
|
.createRequestCycle(swreq, swresp);
|
||||||
|
ThreadContext.setRequestCycle(cycle);
|
||||||
|
Application.get().fetchCreateAndSetSession(
|
||||||
|
Application.get().createRequestCycle(swreq, swresp));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected User getUser() {
|
||||||
|
return CommaFeedSession.get().getUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,15 +5,12 @@ import java.util.Collections;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
|
||||||
|
|
||||||
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.frontend.rest.model.Entries;
|
import com.commafeed.frontend.rest.model.Entries;
|
||||||
import com.commafeed.frontend.rest.model.Entry;
|
import com.commafeed.frontend.rest.model.Entry;
|
||||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||||
@@ -24,36 +21,13 @@ import com.commafeed.model.FeedSubscription;
|
|||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class FeedEntriesREST extends JSONPage {
|
@Path("entries")
|
||||||
|
public class EntriesREST extends AbstractREST {
|
||||||
|
|
||||||
public static final String PARAM_TYPE = "type";
|
@Path("get/{type}/{id}/{readType}")
|
||||||
public static final String PARAM_ID = "id";
|
@GET
|
||||||
public static final String PARAM_READTYPE = "readtype";
|
public Entries getEntries(@PathParam("type") String type,
|
||||||
|
@PathParam("id") String id, @PathParam("readType") String readType) {
|
||||||
@Inject
|
|
||||||
FeedEntryService feedEntryService;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
FeedEntryStatusService feedEntryStatusService;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
FeedSubscriptionService feedSubscriptionService;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
FeedCategoryService feedCategoryService;
|
|
||||||
|
|
||||||
public FeedEntriesREST(PageParameters pageParameters) {
|
|
||||||
super(pageParameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Object getObject(PageParameters parameters) {
|
|
||||||
|
|
||||||
String type = parameters.get(PARAM_TYPE).toString();
|
|
||||||
String id = parameters.get(PARAM_ID).toString();
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
String readType = parameters.get(PARAM_READTYPE).toString();
|
|
||||||
|
|
||||||
Entries entries = new Entries();
|
Entries entries = new Entries();
|
||||||
if ("feed".equals(type)) {
|
if ("feed".equals(type)) {
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.commafeed.frontend.rest;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.WebApplicationException;
|
||||||
|
import javax.ws.rs.core.HttpHeaders;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
import javax.ws.rs.ext.MessageBodyWriter;
|
||||||
|
import javax.ws.rs.ext.Provider;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.apache.commons.lang.time.DateUtils;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializationContext;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
|
||||||
|
@Provider
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public class JSONMessageBodyWriter implements MessageBodyWriter<Object> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isWriteable(Class<?> type, Type genericType,
|
||||||
|
Annotation[] annotations, MediaType mediaType) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getSize(Object t, Class<?> type, Type genericType,
|
||||||
|
Annotation[] annotations, MediaType mediaType) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeTo(Object t, Class<?> type, Type genericType,
|
||||||
|
Annotation[] annotations, MediaType mediaType,
|
||||||
|
MultivaluedMap<String, Object> httpHeaders,
|
||||||
|
OutputStream entityStream) throws IOException,
|
||||||
|
WebApplicationException {
|
||||||
|
httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, mediaType.toString()
|
||||||
|
+ ";charset=UTF-8");
|
||||||
|
|
||||||
|
Gson gson = new GsonBuilder().registerTypeAdapter(Date.class,
|
||||||
|
new DateSerializer()).create();
|
||||||
|
IOUtils.write(gson.toJson(t), entityStream, "UTF-8");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class DateSerializer implements JsonSerializer<Date> {
|
||||||
|
|
||||||
|
private static final String DAY_FORMAT = "yyyy-MM-dd";
|
||||||
|
private static final String TIME_FORMAT = "HH:mm";
|
||||||
|
|
||||||
|
public JsonElement serialize(Date src, Type typeOfSrc,
|
||||||
|
JsonSerializationContext context) {
|
||||||
|
Date now = Calendar.getInstance().getTime();
|
||||||
|
String format = DateUtils.isSameDay(now, src) ? TIME_FORMAT
|
||||||
|
: DAY_FORMAT;
|
||||||
|
return new JsonPrimitive(new SimpleDateFormat(format).format(src));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.commafeed.frontend.rest;
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DateUtils;
|
|
||||||
import org.apache.wicket.markup.html.WebPage;
|
|
||||||
import org.apache.wicket.request.handler.TextRequestHandler;
|
|
||||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
|
||||||
|
|
||||||
import com.commafeed.frontend.CommaFeedSession;
|
|
||||||
import com.commafeed.model.User;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonPrimitive;
|
|
||||||
import com.google.gson.JsonSerializationContext;
|
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public abstract class JSONPage extends WebPage {
|
|
||||||
|
|
||||||
public JSONPage(PageParameters pageParameters) {
|
|
||||||
Gson gson = new GsonBuilder().registerTypeAdapter(Date.class,
|
|
||||||
new DateSerializer()).create();
|
|
||||||
getRequestCycle().scheduleRequestHandlerAfterCurrent(
|
|
||||||
new TextRequestHandler("application/json", "UTF-8", gson
|
|
||||||
.toJson(getObject(pageParameters))));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract Object getObject(PageParameters parameters);
|
|
||||||
|
|
||||||
protected User getUser() {
|
|
||||||
return CommaFeedSession.get().getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class DateSerializer implements JsonSerializer<Date> {
|
|
||||||
|
|
||||||
private static final String DAY_FORMAT = "yyyy-MM-dd";
|
|
||||||
private static final String TIME_FORMAT = "HH:mm";
|
|
||||||
|
|
||||||
public JsonElement serialize(Date src, Type typeOfSrc,
|
|
||||||
JsonSerializationContext context) {
|
|
||||||
Date now = Calendar.getInstance().getTime();
|
|
||||||
String format = DateUtils.isSameDay(now, src) ? TIME_FORMAT
|
|
||||||
: DAY_FORMAT;
|
|
||||||
return new JsonPrimitive(new SimpleDateFormat(format).format(src));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.commafeed.frontend.rest;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.ws.rs.ApplicationPath;
|
||||||
|
import javax.ws.rs.core.Application;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
@ApplicationPath("/rest")
|
||||||
|
public class RESTApplication extends Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Class<?>> getClasses() {
|
||||||
|
Set<Class<?>> set = Sets.newHashSet();
|
||||||
|
set.add(JSONMessageBodyWriter.class);
|
||||||
|
|
||||||
|
set.add(SubscriptionsREST.class);
|
||||||
|
set.add(EntriesREST.class);
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,42 +2,29 @@ package com.commafeed.frontend.rest;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
|
||||||
|
|
||||||
import com.commafeed.backend.dao.FeedCategoryService;
|
|
||||||
import com.commafeed.backend.dao.FeedEntryService;
|
|
||||||
import com.commafeed.backend.dao.FeedSubscriptionService;
|
|
||||||
import com.commafeed.frontend.rest.model.Category;
|
import com.commafeed.frontend.rest.model.Category;
|
||||||
import com.commafeed.frontend.rest.model.Subscription;
|
import com.commafeed.frontend.rest.model.Subscription;
|
||||||
import com.commafeed.model.FeedCategory;
|
import com.commafeed.model.FeedCategory;
|
||||||
import com.commafeed.model.FeedSubscription;
|
import com.commafeed.model.FeedSubscription;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
public class SubscriptionsREST extends AbstractREST {
|
||||||
public class FeedSubscriptionsREST extends JSONPage {
|
|
||||||
|
|
||||||
@Inject
|
@Path("subscriptions")
|
||||||
FeedSubscriptionService feedSubscriptionService;
|
@GET
|
||||||
|
public Category getSubscriptions() {
|
||||||
@Inject
|
|
||||||
FeedCategoryService feedCategoryService;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
FeedEntryService feedEntryService;
|
|
||||||
|
|
||||||
public FeedSubscriptionsREST(PageParameters pageParameters) {
|
|
||||||
super(pageParameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Object getObject(PageParameters parameters) {
|
|
||||||
List<FeedCategory> categories = feedCategoryService.findAll(getUser());
|
|
||||||
Category root = new Category();
|
Category root = new Category();
|
||||||
|
|
||||||
|
List<FeedCategory> categories = feedCategoryService.findAll(getUser());
|
||||||
addChildren(categories, root);
|
addChildren(categories, root);
|
||||||
|
|
||||||
root.setId("all");
|
root.setId("all");
|
||||||
root.setName("All");
|
root.setName("All");
|
||||||
|
|
||||||
for (FeedSubscription subscription : feedSubscriptionService
|
for (FeedSubscription subscription : feedSubscriptionService
|
||||||
.findWithoutCategories(getUser())) {
|
.findWithoutCategories(getUser())) {
|
||||||
Subscription sub = new Subscription();
|
Subscription sub = new Subscription();
|
||||||
@@ -75,4 +62,5 @@ public class FeedSubscriptionsREST extends JSONPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.commafeed.frontend.rest.model;
|
package com.commafeed.frontend.rest.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class Category {
|
public class Category implements Serializable {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private List<Category> children = Lists.newArrayList();
|
private List<Category> children = Lists.newArrayList();
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.commafeed.frontend.rest.model;
|
package com.commafeed.frontend.rest.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class Entries {
|
public class Entries implements Serializable {
|
||||||
private String name;
|
private String name;
|
||||||
private List<Entry> entries = Lists.newArrayList();
|
private List<Entry> entries = Lists.newArrayList();
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.commafeed.frontend.rest.model;
|
package com.commafeed.frontend.rest.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class Entry {
|
public class Entry implements Serializable {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String title;
|
private String title;
|
||||||
private String content;
|
private String content;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.commafeed.frontend.rest.model;
|
package com.commafeed.frontend.rest.model;
|
||||||
|
|
||||||
public class Subscription {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class Subscription implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
private int unread;
|
private int unread;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>Wicket</filter-name>
|
<filter-name>Wicket</filter-name>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.factory('CategoryService', [ '$resource', '$http',
|
|||||||
method : 'GET'
|
method : 'GET'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res = $resource('subscriptions', {}, actions);
|
res = $resource('rest/subscriptions', {}, actions);
|
||||||
return res
|
return res
|
||||||
} ]);
|
} ]);
|
||||||
|
|
||||||
@@ -17,12 +17,10 @@ module.factory('EntryService', [ '$resource', '$http',
|
|||||||
'getUnread' : {
|
'getUnread' : {
|
||||||
method : 'GET',
|
method : 'GET',
|
||||||
params : {
|
params : {
|
||||||
_type : 'category',
|
_method : 'get'
|
||||||
_id : '1',
|
|
||||||
_readtype : 'unread',
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res = $resource('entries/:_type/:_id/:_readtype', {}, actions);
|
res = $resource('rest/entries/:_method/:_type/:_id/:_readtype', {}, actions);
|
||||||
return res
|
return res
|
||||||
} ]);
|
} ]);
|
||||||
Reference in New Issue
Block a user