-
Notifications
You must be signed in to change notification settings - Fork 0
feat(#333): 브랜드 검색 api 추가 #349
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f6ed47c
feat(#333): 브랜드 검색 api 추가
yerimi00 3f23ec5
refactor(#333): N+1 제거를 위한 브랜드 설명 태그 배치 조회
yerimi00 9de60a8
refactor(#333): 브랜드 검색을 DB 레벨 필터/정렬/페이지네이션으로 개선
yerimi00 c6e17d9
fix(#333): 빌드에러 수정
yerimi00 8b47c47
chore(#333): dev merge
yerimi00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...java/com/example/RealMatch/match/domain/repository/MatchBrandHistoryRepositoryCustom.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.example.RealMatch.match.domain.repository; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.data.domain.Page; | ||
| import org.springframework.data.domain.Pageable; | ||
|
|
||
| import com.example.RealMatch.match.domain.entity.MatchBrandHistory; | ||
| import com.example.RealMatch.match.domain.entity.enums.BrandSortType; | ||
| import com.example.RealMatch.match.domain.entity.enums.CategoryType; | ||
|
|
||
| public interface MatchBrandHistoryRepositoryCustom { | ||
|
|
||
| Page<MatchBrandHistory> searchBrands( | ||
| Long userId, | ||
| String title, | ||
| CategoryType category, | ||
| BrandSortType sortBy, | ||
| List<String> tags, | ||
| Pageable pageable | ||
| ); | ||
|
|
||
| long countSearchBrands( | ||
| Long userId, | ||
| String title, | ||
| CategoryType category, | ||
| List<String> tags | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
filterBrandByTags메소드에서 태그를 비교하는 로직이 비효율적입니다.normalizedBrandTags가List인 상태에서contains를 호출하면 내부적으로 반복문이 실행되어 O(N*M)의 시간 복잡도를 가집니다 (N: 필터 태그 수, M: 브랜드 태그 수).normalizedBrandTags를Set으로 변환하여contains호출 시 O(1)의 시간 복잡도를 갖도록 하거나,Collections.disjoint를 사용하여 두 컬렉션에 공통 요소가 있는지 확인하는 것이 더 효율적이고 코드가 간결해집니다.