diff --git a/src/main/java/com/commafeed/frontend/rest/resources/CategoryREST.java b/src/main/java/com/commafeed/frontend/rest/resources/CategoryREST.java index 951d5fed..53963646 100644 --- a/src/main/java/com/commafeed/frontend/rest/resources/CategoryREST.java +++ b/src/main/java/com/commafeed/frontend/rest/resources/CategoryREST.java @@ -193,18 +193,20 @@ public class CategoryREST extends AbstractREST { @Produces(MediaType.APPLICATION_XML) @SecurityCheck(value = Role.USER, apiKeyAllowed = true) public Response getCategoryEntriesAsFeed( - @ApiParam(value = "id of the category, 'all' or 'starred'", required = true) @QueryParam("id") String id, @ApiParam( - value = "tag", - required = true) @QueryParam("tag") String tag) { + @ApiParam(value = "id of the category, 'all' or 'starred'", required = true) @QueryParam("id") String id, + @ApiParam(value = "all entries or only unread ones", allowableValues = "all,unread", required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType, + @ApiParam(value = "only entries newer than this") @QueryParam("newerThan") Long newerThan, + @ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset, + @ApiParam(value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit, + @ApiParam(value = "date ordering", allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, + @ApiParam( + value = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords, + @ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds, + @ApiParam(value = "comma-separated list of excluded subscription ids") @QueryParam("excludedSubscriptionIds") String excludedSubscriptionIds, + @ApiParam(value = "keep only entries tagged with this tag") @QueryParam("tag") String tag) { - Preconditions.checkNotNull(id); - - ReadingMode readType = ReadingMode.all; - ReadingOrder order = ReadingOrder.desc; - int offset = 0; - int limit = 20; - - Response response = getCategoryEntries(id, readType, null, offset, limit, order, null, false, null, tag); + Response response = getCategoryEntries(id, readType, newerThan, offset, limit, order, keywords, onlyIds, excludedSubscriptionIds, + tag); if (response.getStatus() != Status.OK.getStatusCode()) { return response; } diff --git a/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java b/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java index 128d9083..3e439c11 100644 --- a/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java +++ b/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java @@ -196,16 +196,18 @@ public class FeedREST extends AbstractREST { @ApiOperation(value = "Get feed entries as a feed", notes = "Get a feed of feed entries") @Produces(MediaType.APPLICATION_XML) @SecurityCheck(value = Role.USER, apiKeyAllowed = true) - public Response getFeedEntriesAsFeed(@ApiParam(value = "id of the feed", required = true) @QueryParam("id") String id) { + public Response getFeedEntriesAsFeed( + @ApiParam(value = "id of the feed", required = true) @QueryParam("id") String id, + @ApiParam(value = "all entries or only unread ones", allowableValues = "all,unread", required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType, + @ApiParam(value = "only entries newer than this") @QueryParam("newerThan") Long newerThan, + @ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset, + @ApiParam(value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit, + @ApiParam(value = "date ordering", allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, + @ApiParam( + value = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords, + @ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) { - Preconditions.checkNotNull(id); - - ReadingMode readType = ReadingMode.all; - ReadingOrder order = ReadingOrder.desc; - int offset = 0; - int limit = 20; - - Response response = getFeedEntries(id, readType, null, offset, limit, order, null, false); + Response response = getFeedEntries(id, readType, newerThan, offset, limit, order, keywords, onlyIds); if (response.getStatus() != Status.OK.getStatusCode()) { return response; }