-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ion-view Feature/#139 mission view
- Loading branch information
Showing
14 changed files
with
137 additions
and
13 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
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
11 changes: 11 additions & 0 deletions
11
...c/main/java/swm/hkcc/LGTM/app/modules/mission/repository/MissionViewCustomRepository.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,11 @@ | ||
package swm.hkcc.LGTM.app.modules.mission.repository; | ||
|
||
import org.springframework.cache.annotation.Cacheable; | ||
import swm.hkcc.LGTM.app.modules.mission.domain.MissionView; | ||
|
||
import java.util.List; | ||
|
||
public interface MissionViewCustomRepository { | ||
@Cacheable(value = "most_viewed_missions", key = "#p0") | ||
List<MissionView> findByOrderByViewCountDesc(int n); | ||
} |
32 changes: 32 additions & 0 deletions
32
...in/java/swm/hkcc/LGTM/app/modules/mission/repository/MissionViewCustomRepositoryImpl.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,32 @@ | ||
package swm.hkcc.LGTM.app.modules.mission.repository; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Repository; | ||
import swm.hkcc.LGTM.app.modules.mission.domain.MissionView; | ||
|
||
import java.util.List; | ||
|
||
import static swm.hkcc.LGTM.app.modules.mission.domain.QMissionView.missionView; | ||
|
||
|
||
@Slf4j | ||
@Repository | ||
@RequiredArgsConstructor | ||
public class MissionViewCustomRepositoryImpl implements MissionViewCustomRepository { | ||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
@Override | ||
public List<MissionView> findByOrderByViewCountDesc(int n) { | ||
return jpaQueryFactory | ||
.select(missionView) | ||
.from(missionView) | ||
.join(missionView.mission).fetchJoin() // missionView 캐싱 시 mission 정보까지 저장하기 위함 | ||
.join(missionView.viewer).fetchJoin() // missionView 캐싱 시 viewer 정보까지 저장하기 위함 | ||
.groupBy(missionView.mission.missionId) | ||
.orderBy(missionView.mission.missionId.count().desc()) | ||
.limit(n) | ||
.fetch(); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
.../main/java/swm/hkcc/LGTM/app/modules/serverDrivenUI/domain/ABTestUserGroupRepository.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
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