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 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

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @DeleteMapping("/delete") public Object deleteDriverShift(@RequestParam Long id)
    • updateDriverShift

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @PutMapping("/put") public DriverShift updateDriverShift(@RequestParam Long id, @RequestBody @Valid @Valid DriverShift incoming)