From 5c0de10446084fa5827375dc5cca2b3b4f9ad831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Bu=C3=9Fmann?= Date: Wed, 13 Jul 2022 05:58:48 +0200 Subject: [PATCH] updated paths of SpoonacularController to match the rest --- .../whattocook/controller/SpoonacularController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/whattocook/controller/SpoonacularController.java b/backend/src/main/whattocook/controller/SpoonacularController.java index ea63e9d..8fe7fb6 100644 --- a/backend/src/main/whattocook/controller/SpoonacularController.java +++ b/backend/src/main/whattocook/controller/SpoonacularController.java @@ -2,8 +2,8 @@ package whattocook.controller; import org.json.JSONException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.rest.webmvc.BasePathAwareController; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import spoonaccular.RecipeInformation; import spoonaccular.RecipeSearch; @@ -16,7 +16,7 @@ import java.util.LinkedList; import java.util.List; @RestController() -@RequestMapping(path = "recipe") +@BasePathAwareController() public class SpoonacularController { private int nextRecepies=10; private int nextRecepiesForOneRandom=20; @@ -27,18 +27,18 @@ public class SpoonacularController { @Autowired private RecipeSearch recipeSearch; - @GetMapping("/forFridge") + @GetMapping("/recipe/forFridge") public List getForFridge() throws IOException { return recipeSearch.getForIngridients(itemRepository.findAll(), nextRecepies); } - @GetMapping("/random") + @GetMapping("/recipe/random") public List getRandom() throws IOException, InterruptedException, JSONException { return recipeSearch.getRandom(new LinkedList<>(), nextRecepies); //when user has food preferences apply instead of linked list. } - @GetMapping("/oneFridge") + @GetMapping("/recipe/oneFridge") public ExtendedRecipeByIngredient getOneFridge() throws IOException { return recipeSearch.getOneForIngridients(itemRepository.findAll(), nextRecepiesForOneRandom); }