Merge pull request '크리에이터 관리자 - 일자별 콘텐츠 정산 페이징 안되는 버그 수정' (#85) from test into main

Reviewed-on: #85
This commit is contained in:
klaus 2023-11-14 05:17:58 +00:00
commit fe4ecd0ad8
2 changed files with 5 additions and 4 deletions

View File

@ -96,8 +96,8 @@ class CreatorAdminCalculateQueryRepository(private val queryFactory: JPAQueryFac
startDate: LocalDateTime, startDate: LocalDateTime,
endDate: LocalDateTime, endDate: LocalDateTime,
memberId: Long, memberId: Long,
offset: Long = 0, offset: Long,
limit: Long = 20 limit: Long
): List<GetCalculateContentQueryData> { ): List<GetCalculateContentQueryData> {
val orderFormattedDate = getFormattedDate(order.createdAt) val orderFormattedDate = getFormattedDate(order.createdAt)
return queryFactory return queryFactory
@ -125,9 +125,9 @@ class CreatorAdminCalculateQueryRepository(private val queryFactory: JPAQueryFac
.and(order.createdAt.loe(endDate)) .and(order.createdAt.loe(endDate))
) )
.groupBy(audioContent.id, order.type, orderFormattedDate, order.can) .groupBy(audioContent.id, order.type, orderFormattedDate, order.can)
.orderBy(member.id.desc(), orderFormattedDate.desc(), audioContent.id.asc())
.offset(offset) .offset(offset)
.limit(limit) .limit(limit)
.orderBy(member.id.desc(), orderFormattedDate.desc(), audioContent.id.asc())
.fetch() .fetch()
} }

View File

@ -87,7 +87,8 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate
@Transactional(readOnly = true) @Transactional(readOnly = true)
@Cacheable( @Cacheable(
cacheNames = ["cache_ttl_3_hours"], cacheNames = ["cache_ttl_3_hours"],
key = "'creatorCalculateContentList:' + " + "#memberId + ':' + #startDateStr + ':' + #endDateStr" key = "'creatorCalculateContentList:' + " +
"#startDateStr + ':' + #endDateStr + ':' + #memberId + ':' + #offset + ':' + #limit"
) )
fun getCalculateContentList( fun getCalculateContentList(
startDateStr: String, startDateStr: String,