Class ShiftController

java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.ShiftController

@RequestMapping("/api/shift") @RestController public class ShiftController extends ApiController
  • Constructor Details

    • ShiftController

      public ShiftController()
  • Method Details

    • allShifts

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\') || hasRole(\'ROLE_RIDER\')") @GetMapping("/all") public org.springframework.http.ResponseEntity<String> allShifts() throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • shiftByID

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\') || hasRole(\'ROLE_RIDER\')") @GetMapping("/get") public Shift shiftByID(@RequestParam Long id) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • driverShifts

      @PreAuthorize("hasRole(\'ROLE_DRIVER\')") @GetMapping("/drivershifts") public org.springframework.http.ResponseEntity<String> driverShifts() throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • postShift

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Shift postShift(@RequestParam String day, @RequestParam String shiftStart, @RequestParam String shiftEnd, @RequestParam long driverID, @RequestParam long driverBackupID)
    • deleteShift

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteShift(@RequestParam long id)
    • updateShift

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public Shift updateShift(@RequestParam Long id, @RequestBody @Valid @Valid Shift incoming)