Skip to content

haeriskuedic/vehicles-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Instructions

TODOs

  • Implement the TODOs within the CarService.java and CarController.java files
  • Add additional tests to the CarControllerTest.java file based on the TODOs
  • Implement API documentation using Swagger

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}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages