Advertisement
kieni17

Untitled

May 3rd, 2020
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.00 KB | None | 0 0
  1. package dst.ass2.service.api.trip.rest;
  2.  
  3. import dst.ass2.service.api.trip.*;
  4.  
  5. import javax.ws.rs.core.Response;
  6.  
  7. import javax.ws.rs.*;
  8. import javax.ws.rs.core.Response;
  9.  
  10. /**
  11.  * This interface exposes the {@code ITripService} as a RESTful interface.
  12.  */
  13. public interface ITripServiceResource {
  14.  
  15.     // TODO annotate the class and methods with the correct javax.ws.rs annotations
  16.  
  17.  
  18.     @POST
  19.     @Path("/trips")
  20.     Response createTrip(@FormParam("riderId") Long riderId, @FormParam("pickupId") Long pickupId, @FormParam("destinationId") Long destinationId)
  21.             throws EntityNotFoundException, InvalidTripException;
  22.  
  23.  
  24.     @Path("/trips/{id}/confirm")
  25.     Response confirm(@PathParam("id") Long tripId)
  26.             throws EntityNotFoundException, InvalidTripException;
  27.  
  28.     @GET
  29.     @Path("/trips/{id}")
  30.     @Produces("application/json")
  31.     Response getTrip(@PathParam("id") Long tripId)
  32.             throws EntityNotFoundException;
  33.  
  34.     @DELETE
  35.     @Path("/trips/{id}")
  36.     Response deleteTrip(@PathParam("id") Long tripId)
  37.             throws EntityNotFoundException;
  38.  
  39.  
  40.     @POST
  41.     @Path("/trips/{id}/stops")
  42.     Response addStop(@PathParam("id") Long tripId, @FormParam("locationId") Long locationId)
  43.             throws InvalidTripException, EntityNotFoundException;
  44.  
  45.  
  46.     @DELETE
  47.     @Path("/trips/{id}/stops/{locationId}")
  48.     Response removeStop(@PathParam("id") Long tripId, @PathParam("locationId") Long locationId)
  49.             throws InvalidTripException, EntityNotFoundException;
  50.  
  51.     @POST
  52.     @Path("/trips/{id}/match")
  53.     Response match(@PathParam("id") Long tripId, MatchDTO matchDTO)
  54.             throws EntityNotFoundException, DriverNotAvailableException;
  55.  
  56.  
  57.     @POST
  58.     @Path("/trips/{id}/complete")
  59.     Response complete(@PathParam("id") Long tripId, TripInfoDTO tripInfoDTO)
  60.             throws EntityNotFoundException;
  61.  
  62.  
  63.     @Path("/trips/{id}/cancel")
  64.     Response cancel(@PathParam("id") Long tripId)
  65.             throws EntityNotFoundException;
  66.    
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement