Skip to content

Commit

Permalink
[MERGE] Merge pull request #188 from Team-WSS/fix/#174
Browse files Browse the repository at this point in the history
[FIX] 취향 추천 작품 조회 시 novel 중복 제거
  • Loading branch information
Kim-TaeUk authored Sep 18, 2024
2 parents 718f667 + fbb01ea commit cb45798
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ public List<Long> findTodayPopularNovelsId(Pageable pageable) {
public List<Novel> findTasteNovels(List<Genre> preferGenres) {
return jpaQueryFactory
.select(userNovel.novel, userNovel.userNovelId)
.distinct()
.from(userNovel)
.join(userNovel.novel, novel)
.join(novelGenre).on(novelGenre.novel.eq(novel))
.where(novelGenre.genre.in(preferGenres))
.orderBy(userNovel.userNovelId.desc())
.limit(10)
.fetch()
.stream()
.map(tuple -> tuple.get(userNovel.novel))
.distinct()
.limit(10)
.toList();
}
}

0 comments on commit cb45798

Please sign in to comment.