-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ separate recipe info query #445
base: be/dev
Are you sure you want to change the base?
Conversation
- retrieve category and ingredient from respective services - move DTOs to respective domains
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로직을 잘 분리해주셔서 가독성이 더 좋아진 것 같아요👍
코멘트 몇 개 남겼는데 확인 부탁드립니다
고생하셨습니다!
|
||
public List<IngredientResponse> findIngredientByRecipe(Recipe recipe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Transactional(readOnly = true)
을 안붙이신 이유가 있으신가요??
@@ -32,6 +35,13 @@ public void register(List<IngredientCreateRequest> requests, Recipe recipe) { | |||
} | |||
} | |||
|
|||
public List<IngredientResponse> findIngredientByRecipe(Recipe recipe) { | |||
return ingredientRecipeRepository.findAllByRecipeId(recipe.getId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
categoryRecipeRepository.findAllByRecipe(recipe);
엔티티로 조회할지 id로 조회할지 얘기해보면 좋을 것 같아요!
ingredientRecipe.getRequirement()) | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
말도안돼
public RecipeDescriptionResponse( | ||
UserInfo userInfo, | ||
RecipeDataResponse firstResponse, | ||
Recipe recipe, | ||
List<CategoryResponse> category, | ||
List<IngredientResponse> ingredient, | ||
boolean isLike |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
레시피의 정보를 찾아올 때, 조인을 남발하고 한방 쿼리로 찾아오던 것을 변경했습니다.
카테고리는 카테고리서비스에서, 재료는 재료서비스에서 찾아옵니다.
그리고 그것들을 레시피서비스에서 합칩니다!
주된 변경은 레시피서비스이니 그 부분을 시작으로 확인하시면 읽기 편할 겁니다!