@Path(value="microstory") public class StoryResource extends Object
| Constructor and Description |
|---|
StoryResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
findById(int id)
Returns the story identified by the id.
|
javax.ws.rs.core.Response |
findByText(String text,
int page,
int limit)
Returns a list of stories that matched by the text param.
|
javax.ws.rs.core.Response |
findByThemeAndGenreAndDate(es.uvigo.esei.dgss.teama.microstories.domain.enums.Genre genre,
es.uvigo.esei.dgss.teama.microstories.domain.enums.Theme theme,
es.uvigo.esei.dgss.teama.microstories.domain.enums.DateRange dateRange,
int page,
int limit)
Returns a list of stories that agree with the search params.
|
javax.ws.rs.core.Response |
findMostRead()
Returns a list of most read stories in the last month.
|
javax.ws.rs.core.Response |
findRecentStories()
Returns the most recent stories.
|
@Path(value="{id : \\d+}")
@GET
@Produces(value="application/json")
public javax.ws.rs.core.Response findById(@PathParam(value="id")
int id)
id - the id of a story.OK response containing the Story with the
provided id.IllegalArgumentException - if id is null or
if it does not correspond with any story.@Path(value="recent") @GET @Produces(value="application/json") public javax.ws.rs.core.Response findRecentStories()
OK response containing the most recent stories.@Path(value="/")
@GET
@Produces(value="application/json")
public javax.ws.rs.core.Response findByText(@QueryParam(value="contains")
String text,
@QueryParam(value="page")
int page,
@QueryParam(value="limit")
int limit)
text - the string that has to matchpage - the number of pagelimit - the number of stories in the pageOK response containing the Story list with the provided text param.
A BAD_REQUEST response if the text is null or empty. An empty list if there are not any matches.@Path(value="search")
@GET
@Produces(value="application/json")
public javax.ws.rs.core.Response findByThemeAndGenreAndDate(@QueryParam(value="genre")
es.uvigo.esei.dgss.teama.microstories.domain.enums.Genre genre,
@QueryParam(value="theme")
es.uvigo.esei.dgss.teama.microstories.domain.enums.Theme theme,
@QueryParam(value="publication")
es.uvigo.esei.dgss.teama.microstories.domain.enums.DateRange dateRange,
@QueryParam(value="page")
int page,
@QueryParam(value="limit")
int limit)
theme - the theme of the storygenre - the genre of storydateRange - the date ranges to filterpage - the number of pagelimit - the number of stories in the pageOK response containing the Story list with the provided text param.@Path(value="hottest") @GET @Produces(value="application/json") public javax.ws.rs.core.Response findMostRead()
OK response containing a Story list
with the most read stories in the last month.Copyright © 2018. All rights reserved.