Class HelpRequestController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.HelpRequestController
@RequestMapping("/api/helprequest")
@RestController
public class HelpRequestController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionpostHelpRequest
(String requesterEmail, String teamId, String tableOrBreakoutRoom, String explanation, boolean solved, LocalDateTime requestTime) updateHelpRequest
(Long id, @Valid HelpRequest incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
HelpRequestController
public HelpRequestController()
-
-
Method Details
-
allHelpRequests
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<HelpRequest> allHelpRequests() -
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public HelpRequest getById(@RequestParam Long id) -
postHelpRequest
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public HelpRequest postHelpRequest(@RequestParam String requesterEmail, @RequestParam String teamId, @RequestParam String tableOrBreakoutRoom, @RequestParam String explanation, @RequestParam boolean solved, @RequestParam("requestTime") @DateTimeFormat(iso=DATE_TIME) LocalDateTime requestTime) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
updateHelpRequest
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public HelpRequest updateHelpRequest(@RequestParam Long id, @RequestBody @Valid @Valid HelpRequest incoming) -
deleteHelpRequest
-