Interface IFridgeItemsController
- All Known Implementing Classes:
FridgeItemsController
public interface IFridgeItemsController
This interface contains the essential methods for the FridgeItems controller.
- Author:
- Trym Hamer Gudvangen
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
addToFridge
(ItemDTO itemDTO, Long fridgeId) Adds an item to the fridge.org.springframework.http.ResponseEntity<Object>
deleteItemFromFridge
(ItemRemoveDTO itemRemoveDTO) Removes an item from a fridge.org.springframework.http.ResponseEntity<Object>
Retrieves items from a fridge.org.springframework.http.ResponseEntity<Object>
updateFridgeItem
(FridgeItemUpdateDTO fridgeItemUpdateDTO, org.springframework.security.core.Authentication authentication)
-
Method Details
-
addToFridge
@PostMapping("/fridge/add") org.springframework.http.ResponseEntity<Object> addToFridge(@RequestBody ItemDTO itemDTO, @RequestParam(name="fridgeId") Long fridgeId) Adds an item to the fridge.- Parameters:
itemDTO
- The item to add to the fridge.fridgeId
- The id of the fridge to add the item to.- Returns:
- A ResponseEntity indicating the success or failure of the operation.
-
deleteItemFromFridge
@DeleteMapping("/fridge/delete") org.springframework.http.ResponseEntity<Object> deleteItemFromFridge(@RequestBody ItemRemoveDTO itemRemoveDTO) Removes an item from a fridge.- Parameters:
itemRemoveDTO
- The item to remove from the fridge.- Returns:
- A ResponseEntity indicating the success or failure of the operation.
-
updateFridgeItem
@PutMapping("/fridge/update") org.springframework.http.ResponseEntity<Object> updateFridgeItem(@RequestBody FridgeItemUpdateDTO fridgeItemUpdateDTO, org.springframework.security.core.Authentication authentication) -
getFridge
@GetMapping("/fridge/get") org.springframework.http.ResponseEntity<Object> getFridge(@RequestParam(name="fridgeId") Long fridgeId) Retrieves items from a fridge.- Parameters:
fridgeId
- The id of the fridge to retrieve items from.- Returns:
- A ResponseEntity containing the retrieved items, or indicating a failure if appropriate.
-