@Path(value="microstory") @Consumes(value="application/json") @Produces(value="application/json") public class StoryResource extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PAGE_SIZE |
| Constructor and Description |
|---|
StoryResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
exploreStory(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
es.uvigo.esei.dgss.teamc.microstories.service.DateRange dateRange,
int pageIndex,
String today)
Returns a list of stories filter by a search string
|
javax.ws.rs.core.Response |
getStory(Long id)
Returns a story by its id
|
javax.ws.rs.core.Response |
listRecentStories()
Returns the 6 most recent stories stored in the application.
|
javax.ws.rs.core.Response |
searchStory(String searchString,
int pageIndex)
Returns a list of stories filter by a search string
|
public static final int PAGE_SIZE
@Path(value="recent") @GET public javax.ws.rs.core.Response listRecentStories()
OK response containing the list of stories stored in the
application.@Path(value="{id}")
@GET
public javax.ws.rs.core.Response getStory(@PathParam(value="id")
Long id)
id - id of the StoryOK response containing the story identified by given idIllegalArgumentException - if the given id it's null or there's no
story identified by given id@GET
public javax.ws.rs.core.Response searchStory(@QueryParam(value="contains")
String searchString,
@QueryParam(value="page")
int pageIndex)
searchString - String to filter storiespageIndex - Page index of the listOK response containing the list of stories filter by a search stringIllegalArgumentException - if given text is null or the page index is
out of range or negative@Path(value="exploration")
@GET
public javax.ws.rs.core.Response exploreStory(@QueryParam(value="genre")
es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
@QueryParam(value="theme")
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
@QueryParam(value="publication")
es.uvigo.esei.dgss.teamc.microstories.service.DateRange dateRange,
@QueryParam(value="page")
int pageIndex,
@QueryParam(value="today")
String today)
genre - Genre type parameter to filter stories by genretheme - Theme type parameter to filter stories by themedateRange - Date type parameter to filter stories by datepageIndex - Page index of the listOK response containing the list of stories filter by a
genre, theme or publicationCopyright © 2021. All rights reserved.