Package com.unosquare.carmigo.service
Class DriverService
java.lang.Object
com.unosquare.carmigo.service.DriverService
Handles requests regarding the
Driver entity.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDriverById(int platformUserId, DriverRequest driverRequest) Creates a driver.voiddeleteDriverById(int driverId) Deletes a driver.getDriverById(int driverId) Fetches a driver.
-
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 asDriverRequest.- Returns:
- a
DriverResponse.
-
getDriverById
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.
-