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 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

      @PreAuthorize("hasRole(\'ROLE_USER\')") @DeleteMapping("") public Object deleteMenuItemReview(@RequestParam Long id)
    • updateMenuItemReview

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PutMapping("") public MenuItemReviews updateMenuItemReview(@RequestParam Long id, @RequestBody @Valid @Valid MenuItemReviews incoming)