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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String>
deleteUCSBDate
(Long id) 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.org.springframework.http.ResponseEntity<String>
org.springframework.http.ResponseEntity<String>
postUCSBDate
(String quarterYYYYQ, String name, LocalDateTime localDateTime) org.springframework.http.ResponseEntity<String>
updateUCSBDate
(Long id, @Valid UCSBDate incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
UCSBDatesController
public UCSBDatesController()
-
-
Method Details
-
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
-
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.
-