Skip to content

Commit

Permalink
fix: 통계 데이터 타겟 추출 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 25, 2024
1 parent 27017d2 commit 5c99dd3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PoseCountUpdateJob(
.groupBy { totalCount -> totalCount.uid }

/** 집계 처리 데이터 조회 */
val poseCounts = poseCountService.findAllByUidIn(targetUids)
val poseCounts = poseCountService.findAllByUidInAndDate(targetUids, targetDate)
.mapNotNull { poseCount ->
/** 데이터가 없는 경우, 업데이트를 진행하지 않는다. */
val totalCount = totalCountByUid[poseCount.uid] ?: return@mapNotNull null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class PoseCountService(
)
}

suspend fun findAllByUidIn(uids: List<Long>): List<PoseCount> {
suspend fun findAllByUidInAndDate(uids: List<Long>, date: LocalDate): List<PoseCount> {
return withContext(Dispatchers.IO) {
poseCountRepository.findAllByUidIn(uids)
poseCountRepository.findAllByUidInAndDate(uids, date)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.time.LocalDate
interface PoseCountRepository : JpaRepository<PoseCount, Long>, PostCountQRepository {
fun findByUidAndDate(uid: Long, date: LocalDate): PoseCount?

fun findAllByUidIn(uids: List<Long>): List<PoseCount>
fun findAllByUidInAndDate(uids: List<Long>, date: LocalDate): List<PoseCount>

fun deleteAllByUid(uid: Long)
}
Expand Down

0 comments on commit 5c99dd3

Please sign in to comment.