Class DriverAvailabilityController
java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.DriverAvailabilityController
@RequestMapping("/api/driverAvailability")
@RestController
public class DriverAvailabilityController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionpostAvailability
(String day, String startTime, String endTime, String notes) updateAvailability
(Long id, @Valid DriverAvailability incoming) Methods inherited from class edu.ucsb.cs156.gauchoride.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
DriverAvailabilityController
public DriverAvailabilityController()
-
-
Method Details
-
allAvailabilities
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @GetMapping("/all") public Iterable<DriverAvailability> allAvailabilities() -
getById
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @GetMapping("") public DriverAvailability getById(@RequestParam Long id) -
postAvailability
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @PostMapping("/new") public DriverAvailability postAvailability(@RequestParam String day, @RequestParam String startTime, @RequestParam String endTime, @RequestParam String notes) -
deleteAvailability
-
updateAvailability
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @PutMapping("") public DriverAvailability updateAvailability(@RequestParam Long id, @RequestBody @Valid @Valid DriverAvailability incoming)
-