Class DriverService

java.lang.Object
com.unosquare.carmigo.service.DriverService

@Service public class DriverService extends Object
Handles requests regarding the Driver entity.
  • Constructor Details

    • DriverService

      public DriverService()
  • Method Details

    • createDriverById

      @CachePut(value="driver", key="#result.id") public DriverResponse createDriverById(int platformUserId, DriverRequest driverRequest)
      Creates a driver.
      Parameters:
      platformUserId - the platform user id to create a driver.
      driverRequest - the requirements as DriverRequest.
      Returns:
      a DriverResponse.
    • getDriverById

      @Cacheable(value="driver", key="#driverId") public DriverResponse getDriverById(int driverId)
      Fetches a driver.
      Parameters:
      driverId - the driver id to search for.
      Returns:
      a DriverResponse.
    • deleteDriverById

      @CacheEvict(value="driver", key="#driverId") public void deleteDriverById(int driverId)
      Deletes a driver. The platform user is not affected.
      Parameters:
      driverId - the driver id to be deleted.