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

템플릿 생성, 수정 쿼리 성능 개선 #715

Merged
merged 6 commits into from
Sep 27, 2024

Conversation

zangsu
Copy link
Contributor

@zangsu zangsu commented Sep 26, 2024

@zangsu zangsu added refactor 요구사항이 바뀌지 않은 변경사항 BE 백엔드 labels Sep 26, 2024
@zangsu zangsu added this to the 5차 스프린트🍗 milestone Sep 26, 2024
@zangsu zangsu self-assigned this Sep 26, 2024
jminkkk
jminkkk previously approved these changes Sep 27, 2024
@@ -13,6 +13,8 @@ public interface TagRepository {

Optional<Tag> findByName(String name);

List<Tag> findByNameIn(List<String> names);
Copy link
Contributor

Choose a reason for hiding this comment

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

다음에 테스트 추가해주세요~!!

zeus6768
zeus6768 previously approved these changes Sep 27, 2024
Copy link
Contributor

@zeus6768 zeus6768 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 18 to 20
List<String> findNameByNamesIn(List<String> names);

Tag save(Tag tag);
Copy link
Contributor

Choose a reason for hiding this comment

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

테스트코드에서만 사용되는 메서드입니다~!

Suggested change
List<String> findNameByNamesIn(List<String> names);
Tag save(Tag tag);

@zangsu zangsu dismissed stale reviews from zeus6768 and jminkkk via 576b094 September 27, 2024 01:42
kyum-q
kyum-q previously approved these changes Sep 27, 2024
.map(tag -> new TemplateTag(template, tag))
.toList()
);
List<Tag> existingTags = new ArrayList<>(tagRepository.findByNameIn(tagNames));
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

Choose a reason for hiding this comment

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

existingTags 에 새로운 원소를 추가하는 로직이 존재해요.
findByNameIn 의 return 값이 UnmodifiableList 라서 수정 가능한 리스트로 변경해 주는 로직입니다!

Comment on lines +29 to +32
List<Tag> existingTags = new ArrayList<>(tagRepository.findByNameIn(tagNames));
List<String> existNames = existingTags.stream()
.map(Tag::getName)
.toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

나중에 repository로 부터 name만 받도록 수정해서 커버링 인덱스를 사용해봐요 ~

jminkkk
jminkkk previously approved these changes Sep 27, 2024
zeus6768
zeus6768 previously approved these changes Sep 27, 2024
HoeSeong123
HoeSeong123 previously approved these changes Sep 27, 2024
Copy link
Contributor

@HoeSeong123 HoeSeong123 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.

@jminkkk jminkkk merged commit 523f563 into dev/be Sep 27, 2024
6 checks passed
@jminkkk jminkkk deleted the refactor/673-performance-template-create-update branch September 27, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 refactor 요구사항이 바뀌지 않은 변경사항
Projects
Status: Weekend Done
Development

Successfully merging this pull request may close these issues.

5 participants