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

    • allUCSBDiningCommonsMenuItems

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBDiningCommonsMenuItems> allUCSBDiningCommonsMenuItems()
      List all UCSB dining common items
      Returns:
      an iterable of UCSBDiningCommonsMenuItems
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public UCSBDiningCommonsMenuItems getById(@RequestParam Long id)
      Get a single DiningCommonsMenuItems by id
      Parameters:
      id - the id of the DiningCommonsMenuItems
      Returns:
      a UCSBDiningCommonsMenuItems
    • postUCSBDiningCommonsMenuItems

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public UCSBDiningCommonsMenuItems postUCSBDiningCommonsMenuItems(@RequestParam String diningCommonsCode, @RequestParam String name, @RequestParam String station) throws com.fasterxml.jackson.core.JsonProcessingException
      Create a new DiningCommonsMenuItems
      Parameters:
      diningCommonsCode - the dining common code
      name - the name items
      station - the item station
      Returns:
      the saved menu item
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteUCSBDiningCommonsMenuItems

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteUCSBDiningCommonsMenuItems(@RequestParam Long id)
      Delete a UCSBDiningCommonsMenuItems
      Parameters:
      id - the id of the DiningCommonsMenuItems to delete
      Returns:
      a message indicating the DiningCommonsMenuItems was deleted
    • updateUCSBDiningCommonsMenuItems

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBDiningCommonsMenuItems updateUCSBDiningCommonsMenuItems(@RequestParam Long id, @RequestBody @Valid @Valid UCSBDiningCommonsMenuItems incoming)
      Update a single DiningCommonsMenuItems
      Parameters:
      id - id of the DiningCommonsMenuItems to update
      incoming - the new DiningCommonsMenuItems
      Returns:
      the updated DiningCommonsMenuItems object