Skip to content
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 home API and recipe description API #350

Merged
merged 5 commits into from
Sep 23, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 9, 2024

closes #349

@github-actions github-actions bot added ✨ feature new feature BE Backend labels Sep 9, 2024
@hyxrxn hyxrxn linked an issue Sep 9, 2024 that may be closed by this pull request
Copy link
Contributor Author

Overall Project 93.01% 🍏
Files changed 100% 🍏

File Coverage
RecipeDescriptionResponse.java 100% 🍏
MainRecipeResponse.java 100% 🍏
RecipeService.java 100% 🍏
RecipeController.java 100% 🍏

Copy link
Contributor

@hyxrxn hyxrxn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

레시피 목록 api와 레시피 상세 설명 api를 분리했습니다.

일단 기능 완성을 확인하고, swagger에 반영하기 위해 컨트롤러에 E2E 테스트 하나만 추가했습니다.

findRecipeData(List<Long> recipeIds) 에서는 더이상 카테고리와 재료가 필요하지 않아 RecipeDataResponse를 사용할 필요 없고, 쿼리문에서 join 또한 필요 없습니다. 하지만 아직 수정하지는 않은 상태입니다!
기능이 목표한대로 돌아가는 것을 우선순위로 삼았기 때문에...

참고해서 확인해주시면 감사하겠습니다~

Copy link
Contributor

@hyxrxn hyxrxn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이제 findRecipeData(List<Long> recipeIds)에서도 불필요한 필드 제거한 레코드를 사용합니다~~~

Copy link
Contributor Author

Overall Project 93.06% 🍏
Files changed 100% 🍏

File Coverage
RecipeDescriptionResponse.java 100% 🍏
RecipeHomeResponse.java 100% 🍏
RecipeHomeWithMineResponse.java 100% 🍏
RecipeService.java 100% 🍏
RecipeController.java 100% 🍏

Copy link
Contributor

@tackyu tackyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아토 고생많으셨습니다!

Comment on lines 119 to 120
private List<RecipeHomeWithMineResponse> convertToRecipeHomeResponses(
UserInfo userInfo,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

메서드명을 수정해야 할 것 같습니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

없어도 되는 메서드라 지워버렸습니닷...
레시피 아이디 기준으로 해서 하나로 묶을 필요가 없네요

Comment on lines 133 to 134
private RecipeHomeWithMineResponse getMainRecipeResponse(UserInfo userInfo, List<RecipeHomeResponse> groupedResponses) {
RecipeHomeResponse firstResponse = groupedResponses.getFirst();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

메서드명을 수정해야 할 것 같아요!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위 코멘트와 같은 이유로 없애버렸습니다!

Copy link

@HaiSeong HaiSeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아토 수고 많았습니다!

Copy link
Contributor Author

Overall Project 93.04% 🍏
Files changed 100% 🍏

File Coverage
RecipeDescriptionResponse.java 100% 🍏
RecipeHomeResponse.java 100% 🍏
RecipeHomeWithMineResponse.java 100% 🍏
RecipeService.java 100% 🍏
RecipeController.java 100% 🍏

Copy link

@HaiSeong HaiSeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 다시 리뷰를 하며 로직을 확인했습니다. 수정사항 잘 확인했고 문제가 없어 보입니다.

기존 코드의 검증 로직 하나가 수정이 필요해 보이는데 확인가능하신가요?

@@ -50,7 +52,7 @@ public class RecipeService {
private final CommentService commentService;
private final RecipeLikeService recipeLikeService;

public List<MainRecipeResponse> readRecipes(UserInfo userInfo, PageRecipeRequest pageRecipeRequest) {
public List<RecipeHomeWithMineResponse> readRecipes(UserInfo userInfo, PageRecipeRequest pageRecipeRequest) {
Pageable pageable = getValidatedPageable(pageRecipeRequest.pageNumber(), pageRecipeRequest.pageSize());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아토가 수정한 내용은 아니긴 합니다.
로직을 전체적으로 확인하다가 보니getValidatedPageable의 검증내용이 service가 아닌 controller 혹은 dto에 어울리는 내용인것 같아 리뷰를 남깁니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

열심히 봐달라고 요청하니 정말 열심히 봐주셨군요.
매우 동의하고 칭찬합니다. 💯

옮겨보았으니 확인 한 번 해주시죠!

Copy link
Contributor Author

Overall Project 93.04% 🍏
Files changed 100% 🍏

File Coverage
PageRecipeRequest.java 100% 🍏
RecipeDescriptionResponse.java 100% 🍏
RecipeHomeResponse.java 100% 🍏
RecipeHomeWithMineResponse.java 100% 🍏
RecipeService.java 100% 🍏
RecipeController.java 100% 🍏

@hyxrxn hyxrxn merged commit 21216d6 into be/dev Sep 23, 2024
1 check passed
@hyxrxn hyxrxn deleted the be/feat/349 branch September 23, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE Backend ✨ feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ separate home API and recipe description API
3 participants