-
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
[BE] feat: 전체 태그 목록 조회 기능 추가 #161
Conversation
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.
최고네요 👍
} | ||
|
||
private void 전체_태그_목록_조회_결과를_검증한다(final ExtractableResponse<Response> response, final List<Tag> tags) { | ||
final var expectedByType = tags.stream().collect(Collectors.groupingBy(Tag::getTagType)); |
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.
Collectors.groupingBy()는 처음 보네요
덕분에 새로운 지식 공부했습니다 👍👍
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<TagsResponse> getAllTags() { | ||
final List<TagsResponse> responses = new ArrayList<>(); | ||
for (final TagType tagType : TagType.values()) { | ||
getTagsByTagType(responses, tagType); | ||
} | ||
return responses; | ||
} | ||
|
||
private void getTagsByTagType(final List<TagsResponse> responses, final TagType tagType) { | ||
final List<TagDto> tags = tagRepository.findTagsByTagType(tagType).stream() | ||
.map(TagDto::toDto) | ||
.collect(Collectors.toList()); | ||
final TagsResponse tagsResponse = TagsResponse.toResponse(tagType.name(), tags); | ||
responses.add(tagsResponse); | ||
} |
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<TagsResponse> getAllTags() { | |
final List<TagsResponse> responses = new ArrayList<>(); | |
for (final TagType tagType : TagType.values()) { | |
getTagsByTagType(responses, tagType); | |
} | |
return responses; | |
} | |
private void getTagsByTagType(final List<TagsResponse> responses, final TagType tagType) { | |
final List<TagDto> tags = tagRepository.findTagsByTagType(tagType).stream() | |
.map(TagDto::toDto) | |
.collect(Collectors.toList()); | |
final TagsResponse tagsResponse = TagsResponse.toResponse(tagType.name(), tags); | |
responses.add(tagsResponse); | |
} | |
public List<TagsResponse> getAllTags() { | |
final List<TagsResponse> responses = new ArrayList<>(); | |
for (final TagType tagType : TagType.values()) { | |
responses.add(getTagsByTagType(responses, tagType)); | |
} | |
return responses; | |
} | |
private TagsResponse getTagsByTagType(final TagType tagType) { | |
final List<TagDto> tags = tagRepository.findTagsByTagType(tagType).stream() | |
.map(TagDto::toDto) | |
.collect(Collectors.toList()); | |
return TagsResponse.toResponse(tagType.name(), tags); | |
} |
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.
메소드 이름이 getTagsByTagType
니까 TagsResponse를 반환하고 getAllTags
에서 add해주는건 어떨까용
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.
저희에 핵심 기능인 태그 구현 고생하셨습니다!!
LGTM~👍
Issue
✨ 구현한 기능
전체 태그 목록을 조회하는 기능 구현
TASTE
,PRICE
,ETC
📢 논의하고 싶은 내용
DTO 패키지 위치
product.dto
에 위치하는데, review 관련 dto 패키지는review.presentation.dto
에 위치함service 테스트 관련
성능 관련
⏰ 일정