Class UCSBDiningCommonsMenuItemsController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UCSBDiningCommonsMenuItemsController

@RequestMapping("/api/ucsbdiningcommonsmenuitems") @RestController public class UCSBDiningCommonsMenuItemsController extends ApiController
  • Constructor Details

    • UCSBDiningCommonsMenuItemsController

      public UCSBDiningCommonsMenuItemsController()
  • Method Details

    • allMenuItems

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBDiningCommonsMenuItems> allMenuItems()
    • postMenuItems

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/post") public UCSBDiningCommonsMenuItems postMenuItems(@RequestParam String diningCommonsCode, @RequestParam String name, @RequestParam String station) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public UCSBDiningCommonsMenuItems getById(@RequestParam Long id)
    • deleteMenuItem

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteMenuItem(@RequestParam Long id)
    • updateMenuItem

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBDiningCommonsMenuItems updateMenuItem(@RequestParam Long id, @RequestBody @Valid @Valid UCSBDiningCommonsMenuItems incoming)