Implement TripService REST (2.1.3.1)
This commit is contained in:
+29
-16
@@ -2,35 +2,48 @@ package dst.ass2.service.api.trip.rest;
|
||||
|
||||
import dst.ass2.service.api.trip.*;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
||||
/**
|
||||
* This interface exposes the {@code ITripService} as a RESTful interface.
|
||||
*/
|
||||
@Path("trips")
|
||||
public interface ITripServiceResource {
|
||||
@POST
|
||||
Response createTrip(@FormParam("riderId") Long riderId, @FormParam("pickupId") Long pickupId, @FormParam("destinationId") Long destinationId)
|
||||
throws EntityNotFoundException, InvalidTripException;
|
||||
|
||||
// TODO annotate the class and methods with the correct javax.ws.rs annotations
|
||||
@PATCH
|
||||
@Path("{id}/confirm")
|
||||
Response confirm(@PathParam("id") Long tripId) throws EntityNotFoundException, InvalidTripException;
|
||||
|
||||
Response createTrip(Long riderId, Long pickupId, Long destinationId)
|
||||
throws EntityNotFoundException, InvalidTripException;
|
||||
@GET
|
||||
@Path("{id}")
|
||||
Response getTrip(@PathParam("id") Long tripId) throws EntityNotFoundException;
|
||||
|
||||
Response confirm(Long tripId) throws EntityNotFoundException, InvalidTripException;
|
||||
@DELETE
|
||||
@Path("{id}")
|
||||
Response deleteTrip(@PathParam("id") Long tripId) throws EntityNotFoundException;
|
||||
|
||||
Response getTrip(Long tripId) throws EntityNotFoundException;
|
||||
@POST
|
||||
@Path("{id}/stops")
|
||||
Response addStop(@PathParam("id") Long tripId, @FormParam("locationId") Long locationId) throws InvalidTripException, EntityNotFoundException;
|
||||
|
||||
Response deleteTrip(Long tripId) throws EntityNotFoundException;
|
||||
|
||||
Response addStop(Long tripId, Long locationId) throws InvalidTripException, EntityNotFoundException;
|
||||
|
||||
Response removeStop(Long tripId, Long locationId) throws InvalidTripException, EntityNotFoundException;
|
||||
|
||||
Response match(Long tripId, MatchDTO matchDTO) throws EntityNotFoundException, DriverNotAvailableException;
|
||||
|
||||
Response complete(Long tripId, TripInfoDTO tripInfoDTO) throws EntityNotFoundException;
|
||||
|
||||
Response cancel(Long tripId) throws EntityNotFoundException;
|
||||
@DELETE
|
||||
@Path("{id}/stops")
|
||||
Response removeStop(@PathParam("id") Long tripId, @FormParam("locationId") Long locationId) throws InvalidTripException, EntityNotFoundException;
|
||||
|
||||
@POST
|
||||
@Path("{id}/match")
|
||||
Response match(@PathParam("id") Long tripId, MatchDTO matchDTO) throws EntityNotFoundException, DriverNotAvailableException;
|
||||
|
||||
@POST
|
||||
@Path("{id}/complete")
|
||||
Response complete(@PathParam("id") Long tripId, TripInfoDTO tripInfoDTO) throws EntityNotFoundException;
|
||||
|
||||
@PATCH
|
||||
@Path("{id}/cancel")
|
||||
Response cancel(@PathParam("id") Long tripId) throws EntityNotFoundException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user