Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dst.ass2.service.api.trip.rest;
- import dst.ass2.service.api.trip.*;
- import javax.ws.rs.core.Response;
- import javax.ws.rs.*;
- import javax.ws.rs.core.Response;
- /**
- * This interface exposes the {@code ITripService} as a RESTful interface.
- */
- public interface ITripServiceResource {
- // TODO annotate the class and methods with the correct javax.ws.rs annotations
- @POST
- @Path("/trips")
- Response createTrip(@FormParam("riderId") Long riderId, @FormParam("pickupId") Long pickupId, @FormParam("destinationId") Long destinationId)
- throws EntityNotFoundException, InvalidTripException;
- @Path("/trips/{id}/confirm")
- Response confirm(@PathParam("id") Long tripId)
- throws EntityNotFoundException, InvalidTripException;
- @GET
- @Path("/trips/{id}")
- @Produces("application/json")
- Response getTrip(@PathParam("id") Long tripId)
- throws EntityNotFoundException;
- @DELETE
- @Path("/trips/{id}")
- Response deleteTrip(@PathParam("id") Long tripId)
- throws EntityNotFoundException;
- @POST
- @Path("/trips/{id}/stops")
- Response addStop(@PathParam("id") Long tripId, @FormParam("locationId") Long locationId)
- throws InvalidTripException, EntityNotFoundException;
- @DELETE
- @Path("/trips/{id}/stops/{locationId}")
- Response removeStop(@PathParam("id") Long tripId, @PathParam("locationId") Long locationId)
- throws InvalidTripException, EntityNotFoundException;
- @POST
- @Path("/trips/{id}/match")
- Response match(@PathParam("id") Long tripId, MatchDTO matchDTO)
- throws EntityNotFoundException, DriverNotAvailableException;
- @POST
- @Path("/trips/{id}/complete")
- Response complete(@PathParam("id") Long tripId, TripInfoDTO tripInfoDTO)
- throws EntityNotFoundException;
- @Path("/trips/{id}/cancel")
- Response cancel(@PathParam("id") Long tripId)
- throws EntityNotFoundException;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement