Class MenuItemReviewsController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.MenuItemReviewsController
@RequestMapping("/api/menuitemreviews")
@RestController
public class MenuItemReviewsController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList all MenuItemReviewspostMenuItemReview
(long itemId, String reviewerEmail, int stars, LocalDateTime dateReviewed, String comments) updateMenuItemReview
(Long id, @Valid MenuItemReviews incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
MenuItemReviewsController
public MenuItemReviewsController()
-
-
Method Details
-
allMenuItemReviews
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<MenuItemReviews> allMenuItemReviews()List all MenuItemReviews- Returns:
- an iterable of MenuItemReviews
-
postMenuItemReview
@PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/post") public MenuItemReviews postMenuItemReview(@RequestParam long itemId, @RequestParam String reviewerEmail, @RequestParam int stars, @RequestParam("dateReviewed") @DateTimeFormat(iso=DATE_TIME) LocalDateTime dateReviewed, @RequestParam String comments) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public MenuItemReviews getById(@RequestParam Long id) -
deleteMenuItemReview
-
updateMenuItemReview
@PreAuthorize("hasRole(\'ROLE_USER\')") @PutMapping("") public MenuItemReviews updateMenuItemReview(@RequestParam Long id, @RequestBody @Valid @Valid MenuItemReviews incoming)
-