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
-
Method Summary
Modifier and TypeMethodDescriptionList all UCSB dining common itemsDelete a UCSBDiningCommonsMenuItemsGet a single DiningCommonsMenuItems by idpostUCSBDiningCommonsMenuItems
(String diningCommonsCode, String name, String station) Create a new DiningCommonsMenuItemsupdateUCSBDiningCommonsMenuItems
(Long id, @Valid UCSBDiningCommonsMenuItems incoming) Update a single DiningCommonsMenuItemsMethods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
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 codename
- the name itemsstation
- 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 updateincoming
- the new DiningCommonsMenuItems- Returns:
- the updated DiningCommonsMenuItems object
-