-
Notifications
You must be signed in to change notification settings - Fork 7
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
검색 쿼리 개선 #703
검색 쿼리 개선 #703
Conversation
…에 조회 후 애플리케이션 단에서 template으로 template tag 재조회
… 후 애플리케이션 단에서 template으로 thumbnail 재조회
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<Tag> findAllByTemplateId(Long templateId) { | ||
return templateTagRepository.findAllByTemplateId(templateId).stream() | ||
.map(TemplateTag::getTag) | ||
.toList(); | ||
} |
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.
나중에 Tag 를 받도록 변경하면 좋을 것 같아욧 ~
root.fetch("category", JoinType.LEFT); | ||
root.fetch("member", JoinType.LEFT); |
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.
추후 상수화 해요 ~
List<Long> templateIds = templates.stream() | ||
.map(Template::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.
추후 id만 받도록 코드 개선하면 커버링 인덱스를 이용할 수 있을 것 같아요 ~
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<TemplateTag> getAllTemplateTagsByTemplates(List<Template> templates) { | ||
List<Long> templateIds = templates.stream().map(Template::getId).toList(); |
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.
List<Long> templateIds = templates.stream().map(Template::getId).toList(); | |
List<Long> templateIds = templates.stream() | |
.map(Template::getId) | |
.toList(); |
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.
👍
개선될 부분 코멘트 남겼어요 ~!
@@ -14,6 +14,8 @@ public interface ThumbnailRepository { | |||
|
|||
List<Thumbnail> findAll(); | |||
|
|||
List<Thumbnail> findAllByTemplateIn(List<Long> templateIds); |
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.
List<Thumbnail> findAllByTemplateIn(List<Long> templateIds); | |
List<Thumbnail> findAllByTemplateIdsIn(List<Long> templateIds); |
return new FindAllTemplatesResponse( | ||
page.getTotalPages(), | ||
page.getTotalElements(), | ||
findAllTemplateByResponse); | ||
} | ||
|
||
private List<FindAllTemplateItemResponse> getFindAllTemplateItemResponses(List<Template> templates, LikedChecker likedChecker) { |
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 List<FindAllTemplateItemResponse> getFindAllTemplateItemResponses(List<Template> templates, LikedChecker likedChecker) { | |
private List<FindAllTemplateItemResponse> findAllTemplateItemResponses(List<Template> templates, LikedChecker likedChecker) { |
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.
고생하셨어요~~
@@ -52,6 +52,17 @@ public List<Tag> findAllByTemplate(Template template) { | |||
.toList(); | |||
} | |||
|
|||
public List<Tag> findAllByTemplateId(Long templateId) { |
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.
사용되지 않는 메소드인 것 같네요.
⚡️ 관련 이슈
close #673
📍주요 변경 사항