This project demonstrate the ability of using and working with Spring Data JPA, REST API, complex Hibernate mapping, and in memory database usage for quick test and development.
Goal: A complete Spring Boot RESTful Webservices project. Built on in memory database so very easy to test. To explore and test endpoints just clone and run the application.
Tools used:- Spring Boot
- Hibernate
- Jackson
- MySQL (in memory database)
- Maven
- localhost:8081/h2 -> correspond to in memory h2 database console.
- GET - localhost:8081/api/public/airports -> returns all Airports.
- GET - localhost:8081/api/public/airlines -> returns all Airlines.
- GET - localhost:8081/api/public/airplanes -> returns all Airplanes.
- GET - localhost:8081/api/public/airline/{airlineName}/airplanes -> returns all Airplanes owned by the given Airline.
- GET - localhost:8081/api/public/customers -> returns all Customers.
- GET - localhost:8081/api/public/flights -> returns all Flights.
- GET - localhost:8081/api/public/flights/today -> returns all Flights using Current Systems datetime.
- GET - localhost:8081/api/public/flights/{date} -> returns all Flights by given date.
- GET - localhost:8081/api/public/flights/fare/{fare} -> returns all Flights by given fare.
- GET - localhost:8081/api/public/flights/status/{status} -> returns all Flights by given status.
- GET - localhost:8081/api/public/rsvps/customer/{customerId} -> returns all Reservations by Customer ID.
- GET - localhost:8081/api/public/rsvps/{airline}/active -> returns all ACTIVE Reservations by Airline.
- GET - localhost:8081/api/public/rsvps/{airline}/cancelled -> returns all CANCELLED Reservations by Airline.
- GET - localhost:8081/api/public/rsvps/cancelled -> returns all Reservations that were cancelled.
- POST - localhost:8081/api/public/flight -> insert a Flight into database, does some checking like Loop in Source, Destination - Airports and arrival date must be after the departure date.
- POST - localhost:8081/api/public/rsvp/customer -> makes a reservation for the given customerId with the given flightId. Instead of binding the data, here I used a Map to process this.
- PUT - localhost:8081/api/public/rsvp/cancel/{rsvpId} -> cancel a reservation with the given reservation id.
- PUT - localhost:8081/api/public/flight/cancel/{flightId} -> cancel a flight with the given flight id.
- DELETE - localhost:8081/api/public/delete/customer/{customerId} -> delete a customer associated with the given id, free the reservarions that were made by this customer.