-
Notifications
You must be signed in to change notification settings - Fork 15
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
커뮤니티 전체&추천 여행 목록 조회 쿼리 개선 #709
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
313e6fc
feat: member와 sharedTrip fetch join으로 쿼리
mcodnjs 3f9bda8
feat: tripIds에 해당하는 List<City> 가져오도록 쿼리
mcodnjs dfe6089
feat: tripIds에 해당하는 Like 정보 가져오도록 쿼리
mcodnjs 48e8b0e
feat: 추천 목록 조회에도 적용
mcodnjs 2cdc7e3
feat: recommend 쿼리에서 sharedTrip fetch join으로 쿼리
mcodnjs da260c4
refactor: dto 네이밍 및 패키지 변경
mcodnjs 1aad756
style: 쿼리 포맷 수정
mcodnjs 5ea8a7d
refactor: 일급컬렉션을 사용하여 맵 변환 및 관련 변수명 수정
mcodnjs c0333c3
test: ItemServiceTest delete 메서드 수정
mcodnjs 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
14 changes: 0 additions & 14 deletions
14
backend/src/main/java/hanglog/community/domain/BaseTripInfo.java
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/hanglog/community/domain/LikeInfo.java
This file contains 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,12 @@ | ||
package hanglog.community.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class LikeInfo { | ||
|
||
private final long likeCount; | ||
private final boolean isLike; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/hanglog/community/dto/CityElement.java
This file contains 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,13 @@ | ||
package hanglog.community.dto; | ||
|
||
import hanglog.city.domain.City; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class CityElement { | ||
|
||
private final Long tripId; | ||
private final City city; | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/hanglog/community/dto/CityElements.java
This file contains 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,24 @@ | ||
package hanglog.community.dto; | ||
|
||
import hanglog.city.domain.City; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public class CityElements { | ||
|
||
private final List<CityElement> cityElements; | ||
|
||
public static Map<Long, List<City>> toCityMap(final List<CityElement> cityElements) { | ||
final Map<Long, List<City>> map = new HashMap<>(); | ||
for (final CityElement cityElement : cityElements) { | ||
final Long tripId = cityElement.getTripId(); | ||
final City city = cityElement.getCity(); | ||
map.computeIfAbsent(tripId, k -> new ArrayList<>()).add(city); | ||
} | ||
return map; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/hanglog/community/dto/LikeElement.java
This file contains 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,13 @@ | ||
package hanglog.community.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class LikeElement { | ||
|
||
private final Long tripId; | ||
private final long likeCount; | ||
private final boolean isLike; | ||
} |
22 changes: 22 additions & 0 deletions
22
backend/src/main/java/hanglog/community/dto/LikeElements.java
This file contains 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,22 @@ | ||
package hanglog.community.dto; | ||
|
||
import hanglog.community.domain.LikeInfo; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public class LikeElements { | ||
|
||
private final List<LikeElement> likeElements; | ||
|
||
public static Map<Long, LikeInfo> toLikeMap(final List<LikeElement> likeElements) { | ||
final Map<Long, LikeInfo> map = new HashMap<>(); | ||
for (final LikeElement likeElement : likeElements) { | ||
final LikeInfo likeInfo = new LikeInfo(likeElement.getLikeCount(), likeElement.isLike()); | ||
map.put(likeElement.getTripId(), likeInfo); | ||
} | ||
return map; | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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
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.
여기 건들지도 않았는데 테스트 터짐! 이게 말.이.됩.니.까?
근데 이전 PR에선 안터졌음. 근데 터지는게 맞긴함
왜 안터졌지 ..? 뭔가 놓치고 있나 .. ? 근데 아무리 봐도 잘 모르겠다 ~
쨌든 테스트 터진 문제는 아래와 같습니다.
ExpenseRepository 참조하는데 모킹이 안되어있었고,
delete()
->deleteById()
로 로직 바뀌었는데 verify 검증 부분은 안바꿔줘서 발생한 문제