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_USER\')") @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_USER\')") @GetMapping("") public Shift shiftByID(@RequestParam Long id) 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)
    • updateReview

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