made endpoints better

This commit is contained in:
Bruno
2022-06-17 20:08:24 +02:00
parent 93943149ac
commit 22b84c3565

View File

@@ -27,18 +27,18 @@ public class SpoonacularController {
@Autowired
private SpoonacularApiService service;
@GetMapping("forFridge")
@GetMapping("/forFridge")
public HttpEntity<JSONArray> getForFridge() throws IOException, InterruptedException, JSONException {
return new HttpEntity<JSONArray>(service.getForIngridients(itemRepository.findAll(), nextRecepies));
}
@GetMapping("random")
@GetMapping("/random")
public HttpEntity<JSONArray> getRandom() throws IOException, InterruptedException, JSONException {
return new HttpEntity<JSONArray>(service.getRandom(new LinkedList<>(), nextRecepies));
//when user has food preferences apply instead of linked list.
}
@GetMapping("oneFridge")
@GetMapping("/oneFridge")
public HttpEntity<JSONObject> getOneFridge() throws IOException, InterruptedException, JSONException {
return new HttpEntity<JSONObject>(service.getOneForIngridients(itemRepository.findAll(), nextRecepiesForOneRandom));
}