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 TypeMethodDescriptionadminGetById
(Long id) postDriverAvailability
(String day, String startTime, String endTime, String notes) org.springframework.http.ResponseEntity<Object>
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
-
postDriverAvailability
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @PostMapping("/new") public DriverAvailability postDriverAvailability(@RequestParam String day, @RequestParam String startTime, @RequestParam String endTime, @RequestParam String notes) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
allApplications
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @GetMapping("") public Iterable<DriverAvailability> allApplications() -
getById
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @GetMapping("id") public DriverAvailability getById(@RequestParam Long id) -
updateDriverAvailability
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @PutMapping("") public org.springframework.http.ResponseEntity<Object> updateDriverAvailability(@RequestParam Long id, @RequestBody @Valid @Valid DriverAvailability incoming) -
deleteDriverAvailability
-
adminGetById
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("admin") public DriverAvailability adminGetById(@RequestParam Long id) -
allDriverAvailabilities
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/all") public Iterable<DriverAvailability> allDriverAvailabilities()
-