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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteMenuItem
(Long id) postMenuItems
(String diningCommonsCode, String name, String station) updateMenuItem
(Long id, @Valid UCSBDiningCommonsMenuItems incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
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
-
updateMenuItem
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBDiningCommonsMenuItems updateMenuItem(@RequestParam Long id, @RequestBody @Valid @Valid UCSBDiningCommonsMenuItems incoming)
-