diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateController.kt index fe5ecde..ef892f3 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateController.kt @@ -1,7 +1,6 @@ package kr.co.vividnext.sodalive.admin.calculate import kr.co.vividnext.sodalive.common.ApiResponse -import org.springframework.data.domain.Pageable import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping @@ -21,14 +20,6 @@ class AdminCalculateController(private val service: AdminCalculateService) { @GetMapping("/content-list") fun getCalculateContentList( @RequestParam startDateStr: String, - @RequestParam endDateStr: String, - pageable: Pageable - ) = ApiResponse.ok( - service.getCalculateContentList( - startDateStr, - endDateStr, - pageable.offset, - pageable.pageSize.toLong() - ) - ) + @RequestParam endDateStr: String + ) = ApiResponse.ok(service.getCalculateContentList(startDateStr, endDateStr)) } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateQueryRepository.kt index a8d44c8..623061b 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateQueryRepository.kt @@ -46,30 +46,7 @@ class AdminCalculateQueryRepository(private val queryFactory: JPAQueryFactory) { .fetch() } - fun getCalculateContentTotalCount(startDate: LocalDateTime, endDate: LocalDateTime): Int { - return queryFactory - .select(audioContent.id) - .from(useCanCalculate) - .innerJoin(useCanCalculate.useCan, useCan) - .innerJoin(useCan.order, order) - .innerJoin(order.audioContent, audioContent) - .innerJoin(audioContent.member, member) - .where( - useCanCalculate.status.eq(UseCanCalculateStatus.RECEIVED) - .and(order.createdAt.goe(startDate)) - .and(order.createdAt.loe(endDate)) - ) - .groupBy(audioContent.id, order.type) - .fetch() - .size - } - - fun getCalculateContentList( - startDate: LocalDateTime, - endDate: LocalDateTime, - offset: Long, - limit: Long - ): List { + fun getCalculateContentList(startDate: LocalDateTime, endDate: LocalDateTime): List { val orderFormattedDate = getFormattedDate(order.createdAt) return queryFactory .select( diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateService.kt index ff17452..fdaa535 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/AdminCalculateService.kt @@ -72,12 +72,7 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor .toList() } - fun getCalculateContentList( - startDateStr: String, - endDateStr: String, - offset: Long, - limit: Long - ): GetCalculateContentResponse { + fun getCalculateContentList(startDateStr: String, endDateStr: String): List { val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0) .atZone(ZoneId.of("Asia/Seoul")) @@ -89,10 +84,8 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor .withZoneSameInstant(ZoneId.of("UTC")) .toLocalDateTime() - val totalCount = repository.getCalculateContentTotalCount(startDate, endDate) - - val items = repository - .getCalculateContentList(startDate, endDate, offset, limit) + return repository + .getCalculateContentList(startDate, endDate) .map { val orderTypeStr = if (it.orderType == OrderType.RENTAL) { "대여" @@ -115,7 +108,7 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor // 입금액 val depositAmount = settlementAmount - tax - GetCalculateContentItemResponse( + GetCalculateContentResponse( nickname = it.nickname, title = it.title, registrationDate = it.registrationDate, @@ -132,10 +125,5 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor ) } .toList() - - return GetCalculateContentResponse( - totalCount = totalCount, - items = items - ) } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentResponse.kt index e7c0423..60381dc 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentResponse.kt @@ -1,11 +1,6 @@ package kr.co.vividnext.sodalive.admin.calculate data class GetCalculateContentResponse( - val totalCount: Int, - val items: List -) - -data class GetCalculateContentItemResponse( // 등록 크리에이터 닉네임 val nickname: String, // 콘텐츠 제목