Class RecommendationRequestController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.RecommendationRequestController
@RequestMapping("/api/recommendationrequest")
@RestController
public class RecommendationRequestController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionpostRecommendationRequest
(String requesterEmail, String professorEmail, String explanation, LocalDateTime dateRequested, LocalDateTime dateNeeded, Boolean done) recommendationRequest
(Long id, @Valid RecommendationRequest incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
RecommendationRequestController
public RecommendationRequestController()
-
-
Method Details
-
allRecommendationRequest
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<RecommendationRequest> allRecommendationRequest() -
postRecommendationRequest
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public RecommendationRequest postRecommendationRequest(@RequestParam String requesterEmail, @RequestParam String professorEmail, @RequestParam String explanation, @RequestParam("dateRequested") @DateTimeFormat(iso=DATE_TIME) LocalDateTime dateRequested, @RequestParam("dateNeeded") @DateTimeFormat(iso=DATE_TIME) LocalDateTime dateNeeded, @RequestParam Boolean done) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public RecommendationRequest getById(@RequestParam Long id) -
recommendationRequest
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public RecommendationRequest recommendationRequest(@RequestParam Long id, @RequestBody @Valid @Valid RecommendationRequest incoming) -
deleteRecommendationRequest
-