ingredients = member.getIngredientList();
// System.out.println(ingredients);
List@GetMapping("/all")
public String getMatchingRecipes(HttpServletRequest request) throws NotFoundException {
ResultResponse res;
try {
String token = (String) request.getAttribute("token");
Long member_id = jwtUtil.getId(token);
Member member = memberService.findById(member_id);
/* Recipe Crawling하기. */
crawlingRecipeService.crawlingRecipes();
/* Crawling 레시피와 재료 비교하여 레시피 목록 나열하기 */
/* // List<Ingredient> ingredients = member.getIngredientList();
// System.out.println(ingredients);
List<Recipe> matchingRecipes = recipeService.findMatchingRecipes(member, ingredients);
List<MatchingRecipeResponseDto> response = new ArrayList<>();
for (Recipe recipe : matchingRecipes) {
MatchingRecipeResponseDto tmp = MatchingRecipeResponseDto.of(recipe);
System.out.println("제발플리즈");
response.add(tmp);
System.out.println("제발요");
}
*/
res = ResultResponse.builder()
.code(HttpStatus.OK.value())
.message("레시피 목록 로드 성공.")
.result("ddd")
.build();
} catch (Exception e) {
e.printStackTrace();
System.out.println("컨트롤러 에러");
res = ResultResponse.builder()
.code(HttpStatus.INTERNAL_SERVER_ERROR.value())
.message("서버 에러 발생.")
.result(null)
.build();
}
return new ResponseEntity<>(res, HttpStatus.OK);
}
}