@Path(value="event") @Produces(value="application/json") public class EventREST extends Object
| Constructor and Description |
|---|
EventREST() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
cancelEvent(es.uvigo.esei.dgss.lettab.domain.Event event)
Cancel an event
|
javax.ws.rs.core.Response |
createEvent(String login,
es.uvigo.esei.dgss.lettab.domain.Event event)
Creates an event
|
javax.ws.rs.core.Response |
getEventById(int id)
Obtains a detail of Event passed by id
|
javax.ws.rs.core.Response |
getFrontpageEvents()
Obtains a list with 20 events to show in the front page if the number of
events in the system is less than 20 return all the events.
|
javax.ws.rs.core.Response |
getMyCreatedEvents(String login)
Gets the events created by the given user
|
javax.ws.rs.core.Response |
getMyJoinedEvents(String login)
Obtains a list with all the events in which one user has joined and show
that list
|
javax.ws.rs.core.Response |
getPoupularEvents()
Obtains a list with the first five most popular events and show it.
|
javax.ws.rs.core.Response |
modifyEventById(int id,
es.uvigo.esei.dgss.lettab.domain.Event event) |
javax.ws.rs.core.Response |
searchEvent(String text)
REST Method to retrieve a list of events that agree the search pattern in
JSON
|
@GET
@Produces(value="application/json")
@Path(value="joined/{login}")
public javax.ws.rs.core.Response getMyJoinedEvents(@PathParam(value="login")
String login)
login - the login of the user calling for his events@GET @Produces(value="application/json") @Path(value="popular") public javax.ws.rs.core.Response getPoupularEvents()
@GET @Produces(value="application/json") @Path(value="frontpage") public javax.ws.rs.core.Response getFrontpageEvents()
@GET
@Path(value="{id}")
@Produces(value="application/json")
public javax.ws.rs.core.Response getEventById(@PathParam(value="id")
int id)
id - id of the event@PUT
@Path(value="{id}")
@Consumes(value="application/json")
@Produces(value="application/json")
public javax.ws.rs.core.Response modifyEventById(@PathParam(value="id")
int id,
es.uvigo.esei.dgss.lettab.domain.Event event)
id - id of the eventevent - event data to modify@GET
@Path(value="search/{text}")
@Produces(value="application/json")
public javax.ws.rs.core.Response searchEvent(@PathParam(value="text")
String text)
text - The text to search in the events descriptions and titles@POST
@Path(value="/{login}/create")
public javax.ws.rs.core.Response createEvent(@PathParam(value="login")
String login,
es.uvigo.esei.dgss.lettab.domain.Event event)
login - login of event's creatorevent - event's data@GET
@Path(value="/created/{login}")
@Produces(value="application/json")
public javax.ws.rs.core.Response getMyCreatedEvents(@PathParam(value="login")
String login)
login - The login of the user@PUT @Path(value="/cancellation") @Produces(value="application/json") public javax.ws.rs.core.Response cancelEvent(es.uvigo.esei.dgss.lettab.domain.Event event)
event - id of the eventCopyright © 2017. All rights reserved.