Class UCSBDatesController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UCSBDatesController

@RequestMapping("/api/ucsbdates") @RestController public class UCSBDatesController extends ApiController
  • Constructor Details

    • UCSBDatesController

      public UCSBDatesController()
  • Method Details

    • allUCSBDates

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBDate> allUCSBDates()
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public org.springframework.http.ResponseEntity<String> getById(@RequestParam Long id) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • postUCSBDate

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public org.springframework.http.ResponseEntity<String> postUCSBDate(@RequestParam String quarterYYYYQ, @RequestParam String name, @RequestParam("localDateTime") @DateTimeFormat(iso=DATE_TIME) LocalDateTime localDateTime) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteUCSBDate

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public org.springframework.http.ResponseEntity<String> deleteUCSBDate(@RequestParam Long id)
    • updateUCSBDate

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public org.springframework.http.ResponseEntity<String> updateUCSBDate(@RequestParam Long id, @RequestBody @Valid @Valid UCSBDate incoming) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • doesUCSBDateExist

      public edu.ucsb.cs156.example.controllers.UCSBDatesController.UCSBDateOrError doesUCSBDateExist(edu.ucsb.cs156.example.controllers.UCSBDatesController.UCSBDateOrError uoe)
      Pre-conditions: uoe.id is value to look up, uoe.ucsbDate and uoe.error are null Post-condition: if UCSBDate with id uoe.id exists, uoe.ucsbDate now refers to it, and error is null. Otherwise, UCSBDate with id uoe.id does not exist, and error is a suitable return value to report this error condition.