@Path(value="user") public class UserResource extends Object
| Constructor and Description |
|---|
UserResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
deleteStoryById(String login,
int id)
Deletes an story specified by an id.
|
javax.ws.rs.core.Response |
findStoriesByAuthor(String login,
int page,
int limit)
Returns a
List<Story> written by a specified Author. |
javax.ws.rs.core.Response |
findStoryById(String login,
int id)
Returns the story identified by the id.
|
@Path(value="/{login}/microstory")
@GET
@Produces(value="application/json")
public javax.ws.rs.core.Response findStoriesByAuthor(@PathParam(value="login")
String login,
@QueryParam(value="page")
int page,
@QueryParam(value="limit")
int limit)
throws SecurityException,
IllegalArgumentException
List<Story> written by a specified Author.login - the Author that wants to retrieve his stories.page - the number of page.limit - the number of stories in the page.OK response containing the List<Story> with the provided author login.SecurityExceptionIllegalArgumentException@Path(value="/{login}/microstory/{id}")
@GET
@Produces(value="application/json")
@Consumes(value="application/json")
public javax.ws.rs.core.Response findStoryById(@PathParam(value="login")
String login,
@PathParam(value="id")
int id)
throws SecurityException
login - the Author that wants to retrieve his stories.id - the story identifier.OK response containing the Story with the
provided id.IllegalArgumentException - if id is null or
if it does not correspond with any story.SecurityException - if the story can not be found or if the story has not published@Path(value="/{login}/microstory/{id}")
@DELETE
@Produces(value="application/json")
@Consumes(value="application/json")
public javax.ws.rs.core.Response deleteStoryById(@PathParam(value="login")
String login,
@PathParam(value="id")
int id)
throws SecurityException
login - the Author that wants to delete his Story.id - the story identifier.OK response if the story was deleted.IllegalArgumentException - if id is null or if it does not correspond with any story.SecurityException - if the story can not be found or if the author is not the owner.Copyright © 2018. All rights reserved.