Skip to content

Latest commit

 

History

History
103 lines (82 loc) · 1.82 KB

README.md

File metadata and controls

103 lines (82 loc) · 1.82 KB

Vehicles API

A REST API to maintain vehicle data and to provide a complete view of vehicle details including price and address.

Features

  • REST API exploring the main HTTP verbs and features
  • Hateoas
  • Custom API Error handling using ControllerAdvice
  • Swagger API docs
  • HTTP WebClient
  • MVC Test
  • Automatic model mapping

Run the Code

To properly run this application you need to start the Orders API and the Service API first.

$ mvn clean package
$ java -jar target/vehicles-api-0.0.1-SNAPSHOT.jar

Import it in your favorite IDE as a Maven Project.

Operations

Swagger UI: http://localhost:8080/swagger-ui.html

Create a Vehicle

POST /cars

{
   "condition":"USED",
   "details":{
      "body":"sedan",
      "model":"Impala",
      "manufacturer":{
         "code":101,
         "name":"Chevrolet"
      },
      "numberOfDoors":4,
      "fuelType":"Gasoline",
      "engine":"3.6L V6",
      "mileage":32280,
      "modelYear":2018,
      "productionYear":2018,
      "externalColor":"white"
   },
   "location":{
      "lat":40.73061,
      "lon":-73.935242
   }
}

Retrieve a Vehicle

GET /cars/{id}

This feature retrieves the Vehicle data from the database and access the Pricing Service and Boogle Maps to enrich the Vehicle information to be presented

Update a Vehicle

PUT /cars/{id}

{
   "condition":"USED",
   "details":{
      "body":"sedan",
      "model":"Impala",
      "manufacturer":{
         "code":101,
         "name":"Chevrolet"
      },
      "numberOfDoors":4,
      "fuelType":"Gasoline",
      "engine":"3.6L V6",
      "mileage":32280,
      "modelYear":2018,
      "productionYear":2018,
      "externalColor":"white"
   },
   "location":{
      "lat":40.73061,
      "lon":-73.935242
   }
}

Delete a Vehicle

DELETE /cars/{id}