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 TypeMethodDescriptiondeleteDriverAvailability
(long id) getByIdAdmin
(Long id) postDriverAvailability
(String day, String startTime, String endTime, String notes) updateDriverAvailability
(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
-
allDriverAvailabilitys
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("admin/all") public Iterable<DriverAvailability> allDriverAvailabilitys() -
getByIdAdmin
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("admin") public DriverAvailability getByIdAdmin(@RequestParam Long id) -
updateDriverAvailability
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\') || hasRole(\'ROLE_USER\')") @PutMapping("") public DriverAvailability updateDriverAvailability(@RequestParam Long id, @RequestBody @Valid @Valid DriverAvailability incoming) -
postDriverAvailability
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @PostMapping("/post") public DriverAvailability postDriverAvailability(@RequestParam String day, @RequestParam String startTime, @RequestParam String endTime, @RequestParam String notes) -
deleteDriverAvailability
@PreAuthorize("hasRole(\'ROLE_USER\')") @DeleteMapping("") public Object deleteDriverAvailability(@RequestParam long id)
-