Skip to content

Commit

Permalink
fix : 인기 포즈 목록 쿼리 limit 추가 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjijang authored Jun 17, 2024
1 parent 9b109b9 commit f778aee
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class PoseRepositoryImpl : PoseRepositoryCustom, QuerydslRepositorySupport(Pose:
val postIds = from(tagGroupTag)
.leftJoin(tagGroupTag.tag, tag)
.leftJoin(tag.poseTags, poseTag)
.where(tagGroupTag.tagGroup.tagGroupId.`in`(tagGroupIds)
.and(pose.peopleCount.eq(peopleCount))
.where(
tagGroupTag.tagGroup.tagGroupId.`in`(tagGroupIds)
.and(pose.peopleCount.eq(peopleCount))
)
.groupBy(poseTag.pose.poseId)
.having(poseTag.pose.poseId.count().goe(tagGroupIds.size.toLong()))
Expand All @@ -50,10 +51,11 @@ class PoseRepositoryImpl : PoseRepositoryCustom, QuerydslRepositorySupport(Pose:
}

override fun findOrderByArchive(pageable: Pageable): Page<Pose> {
val contents = from(pose)
val query = from(pose)
.leftJoin(archivedPose).on(archivedPose.pose.eq(pose))
.orderBy(archivedPose.count().desc(), pose.createdAt.desc())
.groupBy(pose.poseId)
val contents = querydsl!!.applyPagination(pageable, query)
.fetch()
return PageableExecutionUtils.getPage(contents, pageable, from(pose)::fetchCount);
}
Expand Down

0 comments on commit f778aee

Please sign in to comment.