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
This is a REST controller for UCSBDiningCommonsMenuItem
  • Constructor Details

    • UCSBDiningCommonsMenuItemsController

      public UCSBDiningCommonsMenuItemsController()
  • Method Details

    • allUCSBDiningCommonsMenuItems

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBDiningCommonsMenuItem> allUCSBDiningCommonsMenuItems()
      List all UCSB Dining Commons Menu Items
      Returns:
      an iterable of UCSBDiningCommonsMenuItem
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public UCSBDiningCommonsMenuItem getById(@RequestParam Long id) throws EntityNotFoundException
      Get a single UCSBDiningCommonsMenuItem via ID
      Parameters:
      id - the id of the UCSBDiningCommonsMenuItem
      Returns:
      a single UCSBDiningCommonsMenuItem
      Throws:
      EntityNotFoundException - if the UCSBDiningCommonsMenuItem is not found
    • updateUCSBDiningCommonsMenuItem

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBDiningCommonsMenuItem updateUCSBDiningCommonsMenuItem(@RequestParam Long id, @Valid @RequestBody @Valid UCSBDiningCommonsMenuItem ucsbDiningCommonsMenuItem)
      Update a single UCSBDiningCommonsMenuItem via diningCommonsCode
      Parameters:
      id - the id of the UCSBDiningCommonsMenuItem
      ucsbDiningCommonsMenuItem - the new UCSBDiningCommonsMenuItem
      Returns:
      a single UCSBDiningCommonsMenuItem
    • deleteById

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteById(@RequestParam Long id) throws EntityNotFoundException
      Deletes a UCSBDiningCommonsMenuItem
      Parameters:
      id - the id of the UCSBDiningCommonsMenuItem
      Throws:
      EntityNotFoundException - if the UCSBDiningCommonsMenuItem is not found
    • postUCSBDiningCommonsMenuItem

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public UCSBDiningCommonsMenuItem postUCSBDiningCommonsMenuItem(@RequestParam String diningCommonsCode, @RequestParam String name, @RequestParam String station) throws com.fasterxml.jackson.core.JsonProcessingException
      Create a new UCSBDiningCommonsMenuItem
      Parameters:
      diningCommonsCode - code of the UCSBDiningCommons
      name - name of the UCSBDiningCommons
      station - station of the UCSBDiningCommons
      Returns:
      the created UCSBDiningCommonsMenuItem
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException