Class DriverShiftController
java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.DriverShiftController
@RequestMapping("/api/drivershifts")
@RestController
public class DriverShiftController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String>
org.springframework.http.ResponseEntity<String>
getDriverShiftsById
(Long driverid) postDriverShift
(Long driverid, String fullName, String day, String startTime, String stopTime, String backupDriver) updateDriverShift
(Long id, @Valid DriverShift incoming) Methods inherited from class edu.ucsb.cs156.gauchoride.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
DriverShiftController
public DriverShiftController()
-
-
Method Details
-
getDriverShifts
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\') || hasRole(\'ROLE_RIDER\')") @GetMapping("/all") public org.springframework.http.ResponseEntity<String> getDriverShifts() throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getDriverShiftsById
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\') || hasRole(\'ROLE_RIDER\')") @GetMapping("/all_driver") public org.springframework.http.ResponseEntity<String> getDriverShiftsById(@RequestParam Long driverid) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
postDriverShift
@PreAuthorize("hasRole(\'ROLE_DRIVER\')") @PostMapping("/post") public DriverShift postDriverShift(@RequestParam Long driverid, @RequestParam String fullName, @RequestParam String day, @RequestParam String startTime, @RequestParam String stopTime, @RequestParam String backupDriver) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
deleteDriverShift
-
updateDriverShift
@PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @PutMapping("/put") public DriverShift updateDriverShift(@RequestParam Long id, @RequestBody @Valid @Valid DriverShift incoming)
-