Merge pull request '관리자 광고통계, 일별 전체 회원 수' (#288) from test into main

Reviewed-on: #288
This commit is contained in:
klaus 2025-03-17 08:50:59 +00:00
commit 545836d43c
2 changed files with 6 additions and 33 deletions

View File

@ -61,12 +61,7 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
.sumOf { it.memberCount }
}
fun getSignUpCountInRange(
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
limit: Long
): List<DateAndMemberCount> {
fun getSignUpCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
return queryFactory
.select(
QDateAndMemberCount(
@ -81,17 +76,10 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
)
.groupBy(getFormattedDate(member.createdAt))
.orderBy(getFormattedDate(member.createdAt).desc())
.offset(offset)
.limit(limit)
.fetch()
}
fun getSignOutCountInRange(
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
limit: Long
): List<DateAndMemberCount> {
fun getSignOutCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
return queryFactory
.select(
QDateAndMemberCount(
@ -106,17 +94,10 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
)
.groupBy(getFormattedDate(signOut.createdAt))
.orderBy(getFormattedDate(signOut.createdAt).desc())
.offset(offset)
.limit(limit)
.fetch()
}
fun getPaymentMemberCountInRange(
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
limit: Long
): List<DateAndMemberCount> {
fun getPaymentMemberCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
return queryFactory
.select(
QDateAndMemberCount(
@ -135,8 +116,6 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
)
.groupBy(getFormattedDate(charge.createdAt))
.orderBy(getFormattedDate(charge.createdAt).desc())
.offset(offset)
.limit(limit)
.fetch()
}

View File

@ -61,23 +61,17 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
val signUpCountInRange = repository.getSignUpCountInRange(
startDate = startDateTime,
endDate = endDateTime,
offset = pageable.offset,
limit = pageable.pageSize.toLong()
endDate = endDateTime
).associateBy({ it.date }, { it.memberCount })
val signOutCountInRange = repository.getSignOutCountInRange(
startDate = startDateTime,
endDate = endDateTime,
offset = pageable.offset,
limit = pageable.pageSize.toLong()
endDate = endDateTime
).associateBy({ it.date }, { it.memberCount })
val paymentMemberCountInRange = repository.getPaymentMemberCountInRange(
startDate = startDateTime,
endDate = endDateTime,
offset = pageable.offset,
limit = pageable.pageSize.toLong()
endDate = endDateTime
)
val paymentMemberCountInRangeMap = paymentMemberCountInRange.associateBy({ it.date }, { it.memberCount })