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

[BE] feat: 꿀조합 검색 기능 구현 #477

Merged
merged 6 commits into from
Aug 17, 2023
Merged

Conversation

Go-Jaecheol
Copy link
Collaborator

Issue

✨ 구현한 기능

꿀조합 검색 기능 구현

  • 검색어(상품 명)를 기준으로 해당 상품이 포함된 꿀조합들 검색
  • 상품 검색 기능처럼 LIKE 연산
  • 페이징 처리 (size : 10, sort : X)

📢 논의하고 싶은 내용

  • X

🎸 기타

  • X

⏰ 일정

  • 추정 시간 : 4h
  • 걸린 시간 : 2.5h

@github-actions
Copy link

github-actions bot commented Aug 16, 2023

Unit Test Results

189 tests   189 ✔️  15s ⏱️
104 suites      0 💤
104 files        0

Results for commit e041eee.

♻️ This comment has been updated with latest results.

Comment on lines +32 to +46
public static SearchRecipeResultDto toDto(final Recipe recipe, final List<RecipeImage> images,
final List<Product> products) {
final List<ProductRecipeDto> productRecipes = products.stream()
.map(ProductRecipeDto::toDto)
.collect(Collectors.toList());

if (images.isEmpty()) {
return new SearchRecipeResultDto(recipe.getId(), null, recipe.getTitle(),
RecipeAuthorDto.toDto(recipe.getMember()), productRecipes, recipe.getFavoriteCount(),
recipe.getCreatedAt());
}
return new SearchRecipeResultDto(recipe.getId(), images.get(0).getImage(), recipe.getTitle(),
RecipeAuthorDto.toDto(recipe.getMember()), productRecipes, recipe.getFavoriteCount(),
recipe.getCreatedAt());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

dto 안에서 dto 를 만드는 것은 가독성이 떨어지는 것 같아요

밖에서 dto 를 다 만들어서 애초부터 넣는 방식은 어떻게 생각하시나요??

Copy link
Collaborator

Choose a reason for hiding this comment

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

현재 레시피 패키지안에서
dto를 만드는 정적팩토리메소드는 대체로
도메인(엔티티)을 파라미터로 받아 dto를 만들고 있습니다.

저는 개인적으로 밖에서 dto를 만들면 서비스 코드가 난잡해지는 것 같아요..!

Copy link
Collaborator

@hanueleee hanueleee 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 +32 to +46
public static SearchRecipeResultDto toDto(final Recipe recipe, final List<RecipeImage> images,
final List<Product> products) {
final List<ProductRecipeDto> productRecipes = products.stream()
.map(ProductRecipeDto::toDto)
.collect(Collectors.toList());

if (images.isEmpty()) {
return new SearchRecipeResultDto(recipe.getId(), null, recipe.getTitle(),
RecipeAuthorDto.toDto(recipe.getMember()), productRecipes, recipe.getFavoriteCount(),
recipe.getCreatedAt());
}
return new SearchRecipeResultDto(recipe.getId(), images.get(0).getImage(), recipe.getTitle(),
RecipeAuthorDto.toDto(recipe.getMember()), productRecipes, recipe.getFavoriteCount(),
recipe.getCreatedAt());
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

현재 레시피 패키지안에서
dto를 만드는 정적팩토리메소드는 대체로
도메인(엔티티)을 파라미터로 받아 dto를 만들고 있습니다.

저는 개인적으로 밖에서 dto를 만들면 서비스 코드가 난잡해지는 것 같아요..!

Copy link
Member

@70825 70825 left a comment

Choose a reason for hiding this comment

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

저는 서비스 로직에서 하면 서비스 코드 길어져서 깔끔하게 dto 안에서 하는게 더 나아보여요

Copy link
Collaborator

@wugawuga wugawuga left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!!

@Go-Jaecheol Go-Jaecheol merged commit 1f43c9e into develop Aug 17, 2023
3 checks passed
@Go-Jaecheol Go-Jaecheol deleted the feat/issue-457 branch August 17, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 꿀조합 검색 기능 구현
4 participants