-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from Guzzing/performance
refactor : 학원 목록 조회 2차 캐시 적용
- Loading branch information
Showing
37 changed files
with
748 additions
and
255 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
...va/org/guzzing/studayserver/domain/academy/facade/dto/AcademiesByLocationFacadeParam.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 org.guzzing.studayserver.domain.academy.facade.dto; | ||
|
||
import org.guzzing.studayserver.domain.academy.service.dto.param.AcademyByLocationWithCursorParam; | ||
import org.guzzing.studayserver.domain.academy.util.Latitude; | ||
import org.guzzing.studayserver.domain.academy.util.Longitude; | ||
|
||
public record AcademiesByLocationFacadeParam( | ||
Latitude baseLatitude, | ||
Longitude baseLongitude, | ||
Long memberId, | ||
Long lastAcademyId | ||
) { | ||
|
||
public AcademyByLocationWithCursorParam toAcademyByLocationWithCursorParam() { | ||
return new AcademyByLocationWithCursorParam( | ||
baseLatitude, | ||
baseLongitude, | ||
memberId, | ||
lastAcademyId | ||
); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
.../org/guzzing/studayserver/domain/academy/facade/dto/AcademiesByLocationFacadeResults.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,55 @@ | ||
package org.guzzing.studayserver.domain.academy.facade.dto; | ||
|
||
import org.guzzing.studayserver.domain.academy.service.dto.result.AcademyByLocationWithCursorAndNotLikeResults; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public record AcademiesByLocationFacadeResults( | ||
List<AcademiesByLocationFacadeResult> academiesByLocationFacadeResults, | ||
long lastAcademyId, | ||
boolean hasNext | ||
) { | ||
public static AcademiesByLocationFacadeResults to( | ||
AcademyByLocationWithCursorAndNotLikeResults results, | ||
Map<Long, Boolean> isLikes | ||
) { | ||
return new AcademiesByLocationFacadeResults( | ||
results.academiesByLocationResults() | ||
.stream() | ||
.map(result -> AcademiesByLocationFacadeResult.to(result, isLikes.get(result.academyId()))) | ||
.toList(), | ||
results.lastAcademyId(), | ||
results.hasNext() | ||
); | ||
} | ||
|
||
public record AcademiesByLocationFacadeResult( | ||
long academyId, | ||
String academyName, | ||
String address, | ||
String contact, | ||
List<String> categories, | ||
double latitude, | ||
double longitude, | ||
String shuttleAvailable, | ||
boolean isLiked | ||
) { | ||
public static AcademiesByLocationFacadeResult to( | ||
AcademyByLocationWithCursorAndNotLikeResults.AcademiesByLocationWithCursorAndNotLikeResult result, | ||
boolean isLiked | ||
) { | ||
return new AcademiesByLocationFacadeResult( | ||
result.academyId(), | ||
result.academyName(), | ||
result.address(), | ||
result.contact(), | ||
result.categories(), | ||
result.latitude(), | ||
result.longitude(), | ||
result.shuttleAvailable(), | ||
isLiked | ||
); | ||
} | ||
} | ||
} |
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
10 changes: 9 additions & 1 deletion
10
...va/org/guzzing/studayserver/domain/academy/repository/academy/AcademyQueryRepository.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
Oops, something went wrong.