Class CarsController

java.lang.Object
net.andresbustamante.yafoot.commons.web.controllers.AbstractController
net.andresbustamante.yafoot.core.web.controllers.CarsController
All Implemented Interfaces:
CarsApi

@RestController public class CarsController extends net.andresbustamante.yafoot.commons.web.controllers.AbstractController implements CarsApi
  • Field Summary

    Fields inherited from class net.andresbustamante.yafoot.commons.web.controllers.AbstractController

    DATABASE_BASIC_ERROR, UNAUTHORISED_USER_ERROR

    Fields inherited from interface net.andresbustamante.yafoot.core.web.controllers.CarsApi

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    CarsController(net.andresbustamante.yafoot.core.services.CarSearchService carSearchService, net.andresbustamante.yafoot.core.services.CarManagementService carManagementService, CarMapper carMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Void>
     
    org.springframework.http.ResponseEntity<Void>
     
    org.springframework.http.ResponseEntity<Car>
     
    org.springframework.http.ResponseEntity<List<Car>>
     
    org.springframework.http.ResponseEntity<Void>
    updateCar(Integer id, CarForm carForm)
     

    Methods inherited from class net.andresbustamante.yafoot.commons.web.controllers.AbstractController

    getLocationURI, getObjectMapper, getRequest, getUserContext, handleConstraintViolationException, translate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.andresbustamante.yafoot.core.web.controllers.CarsApi

    getObjectMapper, getRequest
  • Constructor Details

    • CarsController

      public CarsController(net.andresbustamante.yafoot.core.services.CarSearchService carSearchService, net.andresbustamante.yafoot.core.services.CarManagementService carManagementService, CarMapper carMapper)
  • Method Details

    • loadCars

      public org.springframework.http.ResponseEntity<List<Car>> loadCars()
      Specified by:
      loadCars in interface CarsApi
    • loadCar

      public org.springframework.http.ResponseEntity<Car> loadCar(Integer id)
      Specified by:
      loadCar in interface CarsApi
    • addNewCar

      @CrossOrigin(exposedHeaders="Location") public org.springframework.http.ResponseEntity<Void> addNewCar(CarForm car)
      Specified by:
      addNewCar in interface CarsApi
    • updateCar

      public org.springframework.http.ResponseEntity<Void> updateCar(Integer id, CarForm carForm)
      Specified by:
      updateCar in interface CarsApi
    • deactivateCar

      public org.springframework.http.ResponseEntity<Void> deactivateCar(Integer id)
      Specified by:
      deactivateCar in interface CarsApi