From 0040a521690d35b4c442e3a65c7ac934777b031c Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 28 May 2024 17:51:48 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=EC=BB=A4?= =?UTF-8?q?=EB=AE=A4=EB=8B=88=ED=8B=B0=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20?= =?UTF-8?q?=EC=A0=95=EC=82=B0=20API=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calculate/AdminCalculateController.kt | 14 ++++++++ .../AdminCalculateQueryRepository.kt | 32 +++++++++++++++++ .../admin/calculate/AdminCalculateService.kt | 34 +++++++++++++++++++ .../sodalive/extensions/StringExtensions.kt | 17 ++++++++++ 4 files changed, 97 insertions(+) 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 2231204..30dbe37 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 @@ -34,4 +34,18 @@ class AdminCalculateController(private val service: AdminCalculateService) { @RequestParam startDateStr: String, @RequestParam endDateStr: String ) = ApiResponse.ok(service.getCalculateContentDonationList(startDateStr, endDateStr)) + + @GetMapping("/community-post") + fun getCalculateCommunityPost( + @RequestParam startDateStr: String, + @RequestParam endDateStr: String, + pageable: Pageable + ) = ApiResponse.ok( + service.getCalculateCommunityPost( + startDateStr, + endDateStr, + pageable.offset, + pageable.pageSize.toLong() + ) + ) } 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 6c43dab..cdd1433 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 @@ -8,6 +8,7 @@ import kr.co.vividnext.sodalive.can.use.CanUsage import kr.co.vividnext.sodalive.can.use.QUseCan.useCan import kr.co.vividnext.sodalive.content.QAudioContent.audioContent import kr.co.vividnext.sodalive.content.order.QOrder.order +import kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.QCreatorCommunity.creatorCommunity import kr.co.vividnext.sodalive.live.room.QLiveRoom.liveRoom import kr.co.vividnext.sodalive.member.QMember.member import org.springframework.stereotype.Repository @@ -152,4 +153,35 @@ class AdminCalculateQueryRepository(private val queryFactory: JPAQueryFactory) { .orderBy(member.id.asc(), donationFormattedDate.desc()) .fetch() } + + fun getCalculateCommunityPostList( + startDate: LocalDateTime?, + endDate: LocalDateTime?, + offset: Long, + limit: Long + ): List { + val formattedDate = getFormattedDate(useCan.createdAt) + return queryFactory + .select( + QGetCalculateCommunityPostQueryData( + member.nickname, + Expressions.stringTemplate("substring({0}, 1, 10)", creatorCommunity.content), + formattedDate, + useCan.id.count(), + useCan.can.add(useCan.rewardCan).sum() + ) + ) + .from(useCan) + .innerJoin(useCan.communityPost, creatorCommunity) + .innerJoin(creatorCommunity.member, member) + .where( + useCan.isRefund.isFalse + .and(useCan.canUsage.eq(CanUsage.PAID_COMMUNITY_POST)) + .and(useCan.createdAt.goe(startDate)) + .and(useCan.createdAt.loe(endDate)) + ) + .groupBy(formattedDate, creatorCommunity.id) + .orderBy(member.id.asc(), formattedDate.desc()) + .fetch() + } } 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 8b1bd4c..2e5a780 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 @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.admin.calculate import kr.co.vividnext.sodalive.can.use.CanUsage import kr.co.vividnext.sodalive.content.order.OrderType +import kr.co.vividnext.sodalive.extensions.convertLocalDateTime import org.springframework.cache.annotation.Cacheable import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional @@ -266,4 +267,37 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor } .toList() } + + fun getCalculateCommunityPost( + startDateStr: String, + endDateStr: String, + offset: Long, + limit: Long + ): List { + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) + + return repository + .getCalculateCommunityPostList(startDate, endDate, offset, limit) + .map { + val totalKrw = it.totalCan * 100 + val paymentFee = totalKrw * 0.066f + val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 + val tax = settlementAmount * 0.033 + val depositAmount = settlementAmount - tax + + GetCalculateCommunityPostResponse( + nickname = it.nickname, + title = it.title, + date = it.date, + numberOfPurchase = it.numberOfPurchase.toInt(), + totalCan = it.totalCan, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } + } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt b/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt index ff1bb02..3e810b5 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt @@ -1,9 +1,26 @@ package kr.co.vividnext.sodalive.extensions +import java.time.LocalDate import java.time.LocalDateTime +import java.time.ZoneId import java.time.format.DateTimeFormatter fun String.convertLocalDateTime(format: String): LocalDateTime { val dateTimeFormatter = DateTimeFormatter.ofPattern(format) return LocalDateTime.parse(this, dateTimeFormatter) } + +fun String.convertLocalDateTime( + format: String = "yyyy-MM-dd", + currentTimeZoneStr: String = "ASIA/Seoul", + hour: Int = 0, + minute: Int = 0, + second: Int = 0 +): LocalDateTime { + val dateTimeFormatter = DateTimeFormatter.ofPattern(format) + return LocalDate.parse(this, dateTimeFormatter) + .atTime(hour, minute, second) + .atZone(ZoneId.of(currentTimeZoneStr)) + .withZoneSameInstant(ZoneId.of("UTC")) + .toLocalDateTime() +} From aa7c08850421c9f645ac235e0e072630081107a0 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 29 May 2024 00:08:20 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90,=20=ED=81=AC?= =?UTF-8?q?=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20-=20=EC=A0=95=EC=82=B0=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EA=B2=B0=EA=B3=BC=EA=B0=92=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/calculate/AdminCalculateService.kt | 243 +--------------- .../GetCalculateCommunityPostQueryData.kt | 24 +- .../GetCalculateContentDonationQueryData.kt | 47 +++- .../calculate/GetCalculateContentQueryData.kt | 42 ++- .../calculate/GetCalculateLiveQueryData.kt | 56 +++- .../GetCumulativeSalesByContentResponse.kt | 41 ++- .../CreatorAdminCalculateQueryRepository.kt | 12 +- .../calculate/CreatorAdminCalculateService.kt | 266 ++---------------- 8 files changed, 237 insertions(+), 494 deletions(-) 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 2e5a780..c233788 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 @@ -1,15 +1,9 @@ package kr.co.vividnext.sodalive.admin.calculate -import kr.co.vividnext.sodalive.can.use.CanUsage -import kr.co.vividnext.sodalive.content.order.OrderType import kr.co.vividnext.sodalive.extensions.convertLocalDateTime import org.springframework.cache.annotation.Cacheable import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional -import java.time.LocalDate -import java.time.ZoneId -import java.time.format.DateTimeFormatter -import kotlin.math.roundToInt @Service class AdminCalculateService(private val repository: AdminCalculateQueryRepository) { @@ -19,73 +13,12 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor key = "'calculateLive:' + " + "#startDateStr + ':' + #endDateStr" ) fun getCalculateLive(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")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) return repository .getCalculateLive(startDate, endDate) - .asSequence() - .map { - val canUsageStr = when (it.canUsage) { - CanUsage.LIVE -> { - "유료" - } - - CanUsage.SPIN_ROULETTE -> { - "룰렛" - } - - else -> { - "후원" - } - } - - val numberOfPeople = if (it.canUsage == CanUsage.LIVE) { - it.memberCount.toInt() - } else { - 0 - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalAmount * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateLiveResponse( - email = it.email, - nickname = it.nickname, - date = it.date, - title = it.title, - entranceFee = it.entranceFee, - canUsageStr = canUsageStr, - numberOfPeople = numberOfPeople, - totalAmount = it.totalAmount, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateLiveResponse() } } @Transactional(readOnly = true) @@ -94,59 +27,12 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor key = "'calculateContent:' + " + "#startDateStr + ':' + #endDateStr" ) 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")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) return repository .getCalculateContentList(startDate, endDate) - .asSequence() - .map { - val orderTypeStr = if (it.orderType == OrderType.RENTAL) { - "대여" - } else { - "소장" - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateContentResponse( - nickname = it.nickname, - title = it.title, - registrationDate = it.registrationDate, - saleDate = it.saleDate, - orderType = orderTypeStr, - orderPrice = it.orderPrice, - numberOfPeople = it.numberOfPeople.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateContentResponse() } } @Transactional(readOnly = true) @@ -158,45 +44,7 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor val totalCount = repository.getCumulativeSalesByContentTotalCount() val items = repository .getCumulativeSalesByContent(offset, limit) - .asSequence() - .map { - val orderTypeStr = if (it.orderType == OrderType.RENTAL) { - "대여" - } else { - "소장" - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - CumulativeSalesByContentItem( - nickname = it.nickname, - title = it.title, - registrationDate = it.registrationDate, - orderType = orderTypeStr, - orderPrice = it.orderPrice, - numberOfPeople = it.numberOfPeople.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toCumulativeSalesByContentItem() } return GetCumulativeSalesByContentResponse(totalCount, items) } @@ -210,62 +58,12 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor 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")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) return repository .getCalculateContentDonationList(startDate, endDate) - .asSequence() - .map { - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 - // 유료콘텐츠 (원화 - 결제수수료) 의 90% - // 무료콘텐츠 (원화 - 결제수수료) 의 70% - val settlementAmount = if (it.price > 0) { - (totalKrw.toFloat() - paymentFee) * 0.9 - } else { - (totalKrw.toFloat() - paymentFee) * 0.7 - } - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateContentDonationResponse( - nickname = it.nickname, - title = it.title, - paidOrFree = if (it.price > 0) { - "유료" - } else { - "무료" - }, - registrationDate = it.registrationDate, - donationDate = it.donationDate, - numberOfDonation = it.numberOfDonation.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateContentDonationResponse() } } fun getCalculateCommunityPost( @@ -279,25 +77,6 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor return repository .getCalculateCommunityPostList(startDate, endDate, offset, limit) - .map { - val totalKrw = it.totalCan * 100 - val paymentFee = totalKrw * 0.066f - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - val tax = settlementAmount * 0.033 - val depositAmount = settlementAmount - tax - - GetCalculateCommunityPostResponse( - nickname = it.nickname, - title = it.title, - date = it.date, - numberOfPurchase = it.numberOfPurchase.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } + .map { it.toGetCalculateCommunityPostResponse() } } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateCommunityPostQueryData.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateCommunityPostQueryData.kt index bfe0535..3ab85d2 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateCommunityPostQueryData.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateCommunityPostQueryData.kt @@ -1,6 +1,7 @@ package kr.co.vividnext.sodalive.admin.calculate import com.querydsl.core.annotations.QueryProjection +import kotlin.math.roundToInt data class GetCalculateCommunityPostQueryData @QueryProjection constructor( val nickname: String, @@ -8,4 +9,25 @@ data class GetCalculateCommunityPostQueryData @QueryProjection constructor( val date: String, val numberOfPurchase: Long, val totalCan: Int -) +) { + fun toGetCalculateCommunityPostResponse(): GetCalculateCommunityPostResponse { + val totalKrw = totalCan * 100 + val paymentFee = totalKrw * 0.066f + val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 + val tax = settlementAmount * 0.033 + val depositAmount = settlementAmount - tax + + return GetCalculateCommunityPostResponse( + nickname = nickname, + title = title, + date = date, + numberOfPurchase = numberOfPurchase.toInt(), + totalCan = totalCan, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } +} diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentDonationQueryData.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentDonationQueryData.kt index f479c92..77ed086 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentDonationQueryData.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentDonationQueryData.kt @@ -1,6 +1,7 @@ package kr.co.vividnext.sodalive.admin.calculate import com.querydsl.core.annotations.QueryProjection +import kotlin.math.roundToInt data class GetCalculateContentDonationQueryData @QueryProjection constructor( // 등록 크리에이터 닉네임 @@ -17,4 +18,48 @@ data class GetCalculateContentDonationQueryData @QueryProjection constructor( val numberOfDonation: Long, // 합계 val totalCan: Int -) +) { + fun toGetCalculateContentDonationResponse(): GetCalculateContentDonationResponse { + // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) + val totalKrw = totalCan * 100 + + // 결제수수료 : 6.6% + val paymentFee = totalKrw * 0.066f + + // 정산금액 + // 유료콘텐츠 (원화 - 결제수수료) 의 90% + // 무료콘텐츠 (원화 - 결제수수료) 의 70% + val settlementAmount = if (price > 0) { + (totalKrw.toFloat() - paymentFee) * 0.9 + } else { + (totalKrw.toFloat() - paymentFee) * 0.7 + } + + // 원천세 = 정산금액의 3.3% + val tax = settlementAmount * 0.033 + + // 입금액 + val depositAmount = settlementAmount - tax + + val paidOrFree = if (price > 0) { + "유료" + } else { + "무료" + } + + return GetCalculateContentDonationResponse( + nickname = nickname, + title = title, + paidOrFree = paidOrFree, + registrationDate = registrationDate, + donationDate = donationDate, + numberOfDonation = numberOfDonation.toInt(), + totalCan = totalCan, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } +} diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentQueryData.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentQueryData.kt index 39ca14e..d26e17d 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentQueryData.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateContentQueryData.kt @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.admin.calculate import com.querydsl.core.annotations.QueryProjection import kr.co.vividnext.sodalive.content.order.OrderType +import kotlin.math.roundToInt data class GetCalculateContentQueryData @QueryProjection constructor( // 등록 크리에이터 닉네임 @@ -20,4 +21,43 @@ data class GetCalculateContentQueryData @QueryProjection constructor( val numberOfPeople: Long, // 합계 val totalCan: Int -) +) { + fun toGetCalculateContentResponse(): GetCalculateContentResponse { + val orderTypeStr = if (orderType == OrderType.RENTAL) { + "대여" + } else { + "소장" + } + + // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) + val totalKrw = totalCan * 100 + + // 결제수수료 : 6.6% + val paymentFee = totalKrw * 0.066f + + // 정산금액 = (원화 - 결제수수료) 의 70% + val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 + + // 원천세 = 정산금액의 3.3% + val tax = settlementAmount * 0.033 + + // 입금액 + val depositAmount = settlementAmount - tax + + return GetCalculateContentResponse( + nickname = nickname, + title = title, + registrationDate = registrationDate, + saleDate = saleDate, + orderType = orderTypeStr, + orderPrice = orderPrice, + numberOfPeople = numberOfPeople.toInt(), + totalCan = totalCan, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } +} diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateLiveQueryData.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateLiveQueryData.kt index 5fbfb68..f8b7e02 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateLiveQueryData.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCalculateLiveQueryData.kt @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.admin.calculate import com.querydsl.core.annotations.QueryProjection import kr.co.vividnext.sodalive.can.use.CanUsage +import kotlin.math.roundToInt data class GetCalculateLiveQueryData @QueryProjection constructor( val email: String, @@ -16,4 +17,57 @@ data class GetCalculateLiveQueryData @QueryProjection constructor( val memberCount: Long, // 합계 val totalAmount: Int -) +) { + fun toGetCalculateLiveResponse(): GetCalculateLiveResponse { + val canUsageStr = when (canUsage) { + CanUsage.LIVE -> { + "유료" + } + + CanUsage.SPIN_ROULETTE -> { + "룰렛" + } + + else -> { + "후원" + } + } + + val numberOfPeople = if (canUsage == CanUsage.LIVE) { + memberCount.toInt() + } else { + 0 + } + + // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) + val totalKrw = totalAmount * 100 + + // 결제수수료 : 6.6% + val paymentFee = totalKrw * 0.066f + + // 정산금액 = (원화 - 결제수수료) 의 70% + val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 + + // 원천세 = 정산금액의 3.3% + val tax = settlementAmount * 0.033 + + // 입금액 + val depositAmount = settlementAmount - tax + + return GetCalculateLiveResponse( + email = email, + nickname = nickname, + date = date, + title = title, + entranceFee = entranceFee, + canUsageStr = canUsageStr, + numberOfPeople = numberOfPeople, + totalAmount = totalAmount, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } +} diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCumulativeSalesByContentResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCumulativeSalesByContentResponse.kt index 47bb514..ac2a48c 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCumulativeSalesByContentResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/admin/calculate/GetCumulativeSalesByContentResponse.kt @@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.admin.calculate import com.fasterxml.jackson.annotation.JsonProperty import com.querydsl.core.annotations.QueryProjection import kr.co.vividnext.sodalive.content.order.OrderType +import kotlin.math.roundToInt data class GetCumulativeSalesByContentQueryData @QueryProjection constructor( // 등록 크리에이터 닉네임 @@ -19,7 +20,45 @@ data class GetCumulativeSalesByContentQueryData @QueryProjection constructor( val numberOfPeople: Long, // 합계 val totalCan: Int -) +) { + fun toCumulativeSalesByContentItem(): CumulativeSalesByContentItem { + val orderTypeStr = if (orderType == OrderType.RENTAL) { + "대여" + } else { + "소장" + } + + // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) + val totalKrw = totalCan * 100 + + // 결제수수료 : 6.6% + val paymentFee = totalKrw * 0.066f + + // 정산금액 = (원화 - 결제수수료) 의 70% + val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 + + // 원천세 = 정산금액의 3.3% + val tax = settlementAmount * 0.033 + + // 입금액 + val depositAmount = settlementAmount - tax + + return CumulativeSalesByContentItem( + nickname = nickname, + title = title, + registrationDate = registrationDate, + orderType = orderTypeStr, + orderPrice = orderPrice, + numberOfPeople = numberOfPeople.toInt(), + totalCan = totalCan, + totalKrw = totalKrw, + paymentFee = paymentFee.roundToInt(), + settlementAmount = settlementAmount.roundToInt(), + tax = tax.roundToInt(), + depositAmount = depositAmount.roundToInt() + ) + } +} data class GetCumulativeSalesByContentResponse( @JsonProperty("totalCount") val totalCount: Int, diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateQueryRepository.kt index a6e2585..f62d904 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateQueryRepository.kt @@ -31,17 +31,7 @@ class CreatorAdminCalculateQueryRepository(private val queryFactory: JPAQueryFac endDate: LocalDateTime, memberId: Long ): List { - val formattedDate = Expressions.stringTemplate( - "DATE_FORMAT({0}, {1})", - Expressions.dateTimeTemplate( - LocalDateTime::class.java, - "CONVERT_TZ({0},{1},{2})", - liveRoom.beginDateTime, - "UTC", - "Asia/Seoul" - ), - "%Y-%m-%d" - ) + val formattedDate = getFormattedDate(liveRoom.beginDateTime) return queryFactory .select( diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateService.kt index cb5f11b..46ea0f6 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/creator/admin/calculate/CreatorAdminCalculateService.kt @@ -1,21 +1,12 @@ package kr.co.vividnext.sodalive.creator.admin.calculate -import kr.co.vividnext.sodalive.admin.calculate.CumulativeSalesByContentItem -import kr.co.vividnext.sodalive.admin.calculate.GetCalculateCommunityPostResponse -import kr.co.vividnext.sodalive.admin.calculate.GetCalculateContentDonationResponse -import kr.co.vividnext.sodalive.admin.calculate.GetCalculateContentResponse import kr.co.vividnext.sodalive.admin.calculate.GetCalculateLiveResponse import kr.co.vividnext.sodalive.admin.calculate.GetCumulativeSalesByContentResponse -import kr.co.vividnext.sodalive.can.use.CanUsage -import kr.co.vividnext.sodalive.content.order.OrderType +import kr.co.vividnext.sodalive.extensions.convertLocalDateTime import kr.co.vividnext.sodalive.member.Member import org.springframework.cache.annotation.Cacheable import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional -import java.time.LocalDate -import java.time.ZoneId -import java.time.format.DateTimeFormatter -import kotlin.math.roundToInt @Service class CreatorAdminCalculateService(private val repository: CreatorAdminCalculateQueryRepository) { @@ -25,73 +16,12 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate key = "'creatorCalculateLive:v20240403_01:' + " + "#member + ':' + #startDateStr + ':' + #endDateStr" ) fun getCalculateLive(startDateStr: String, endDateStr: String, member: Member): List { - val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") - val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) return repository .getCalculateLive(startDate, endDate, member.id!!) - .asSequence() - .map { - val canUsageStr = when (it.canUsage) { - CanUsage.LIVE -> { - "유료" - } - - CanUsage.SPIN_ROULETTE -> { - "룰렛" - } - - else -> { - "후원" - } - } - - val numberOfPeople = if (it.canUsage == CanUsage.LIVE) { - it.memberCount.toInt() - } else { - 0 - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalAmount * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateLiveResponse( - email = it.email, - nickname = it.nickname, - date = it.date, - title = it.title, - entranceFee = it.entranceFee, - canUsageStr = canUsageStr, - numberOfPeople = numberOfPeople, - totalAmount = it.totalAmount, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateLiveResponse() } } @Transactional(readOnly = true) @@ -107,59 +37,12 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate offset: Long, limit: Long ): GetCalculateContentListResponse { - val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") - val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) val totalCount = repository.getCalculateContentListTotalCount(startDate, endDate, memberId) val items = repository.getCalculateContentList(startDate, endDate, memberId, offset, limit) - .asSequence() - .map { - val orderTypeStr = if (it.orderType == OrderType.RENTAL) { - "대여" - } else { - "소장" - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateContentResponse( - nickname = it.nickname, - title = it.title, - registrationDate = it.registrationDate, - saleDate = it.saleDate, - orderType = orderTypeStr, - orderPrice = it.orderPrice, - numberOfPeople = it.numberOfPeople.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateContentResponse() } return GetCalculateContentListResponse(totalCount, items) } @@ -173,45 +56,7 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate val totalCount = repository.getCumulativeSalesByContentTotalCount(memberId) val items = repository .getCumulativeSalesByContent(memberId, offset, limit) - .asSequence() - .map { - val orderTypeStr = if (it.orderType == OrderType.RENTAL) { - "대여" - } else { - "소장" - } - - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 = (원화 - 결제수수료) 의 70% - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - CumulativeSalesByContentItem( - nickname = it.nickname, - title = it.title, - registrationDate = it.registrationDate, - orderType = orderTypeStr, - orderPrice = it.orderPrice, - numberOfPeople = it.numberOfPeople.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toCumulativeSalesByContentItem() } return GetCumulativeSalesByContentResponse(totalCount, items) } @@ -229,67 +74,23 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate offset: Long, limit: Long ): GetCreatorCalculateContentDonationResponse { - val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") - val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) val totalCount = repository.getCalculateContentDonationListTotalCount(startDate, endDate, memberId) val items = repository .getCalculateContentDonationList(startDate, endDate, memberId, offset, limit) - .asSequence() - .map { - // 원화 = totalCoin * 100 ( 캔 1개 = 100원 ) - val totalKrw = it.totalCan * 100 - - // 결제수수료 : 6.6% - val paymentFee = totalKrw * 0.066f - - // 정산금액 - // 유료콘텐츠 (원화 - 결제수수료) 의 90% - // 무료콘텐츠 (원화 - 결제수수료) 의 70% - val settlementAmount = if (it.price > 0) { - (totalKrw.toFloat() - paymentFee) * 0.9 - } else { - (totalKrw.toFloat() - paymentFee) * 0.7 - } - - // 원천세 = 정산금액의 3.3% - val tax = settlementAmount * 0.033 - - // 입금액 - val depositAmount = settlementAmount - tax - - GetCalculateContentDonationResponse( - nickname = it.nickname, - title = it.title, - paidOrFree = if (it.price > 0) { - "유료" - } else { - "무료" - }, - registrationDate = it.registrationDate, - donationDate = it.donationDate, - numberOfDonation = it.numberOfDonation.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } - .toList() + .map { it.toGetCalculateContentDonationResponse() } return GetCreatorCalculateContentDonationResponse(totalCount, items) } + @Transactional(readOnly = true) + @Cacheable( + cacheNames = ["cache_ttl_3_hours"], + key = "'creatorCalculateCommunityPost:' + " + + "#startDateStr + ':' + #endDateStr + ':' + #memberId + ':' + #offset + ':' + #limit" + ) fun getCalculateCommunityPost( startDateStr: String, endDateStr: String, @@ -297,40 +98,13 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate offset: Long, limit: Long ): GetCreatorCalculateCommunityPostResponse { - val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") - val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() - - val endDate = LocalDate.parse(endDateStr, dateTimeFormatter).atTime(23, 59, 59) - .atZone(ZoneId.of("Asia/Seoul")) - .withZoneSameInstant(ZoneId.of("UTC")) - .toLocalDateTime() + val startDate = startDateStr.convertLocalDateTime() + val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) val totalCount = repository.getCalculateCommunityPostTotalCount(startDate, endDate, memberId) val items = repository .getCalculateCommunityPostList(startDate, endDate, memberId, offset, limit) - .map { - val totalKrw = it.totalCan * 100 - val paymentFee = totalKrw * 0.066f - val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7 - val tax = settlementAmount * 0.033 - val depositAmount = settlementAmount - tax - - GetCalculateCommunityPostResponse( - nickname = it.nickname, - title = it.title, - date = it.date, - numberOfPurchase = it.numberOfPurchase.toInt(), - totalCan = it.totalCan, - totalKrw = totalKrw, - paymentFee = paymentFee.roundToInt(), - settlementAmount = settlementAmount.roundToInt(), - tax = tax.roundToInt(), - depositAmount = depositAmount.roundToInt() - ) - } + .map { it.toGetCalculateCommunityPostResponse() } return GetCreatorCalculateCommunityPostResponse(totalCount, items) } From 808030100f74f0da9e3ce1286707afb1556be0f5 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 29 May 2024 00:13:58 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=EC=BB=A4?= =?UTF-8?q?=EB=AE=A4=EB=8B=88=ED=8B=B0=20=EA=B2=8C=EC=8B=9C=EB=AC=BC=20?= =?UTF-8?q?=EC=A0=95=EC=82=B0=20=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../calculate/AdminCalculateQueryRepository.kt | 18 ++++++++++++++++++ .../admin/calculate/AdminCalculateService.kt | 8 ++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) 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 cdd1433..e716de3 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 @@ -154,6 +154,24 @@ class AdminCalculateQueryRepository(private val queryFactory: JPAQueryFactory) { .fetch() } + fun getCalculateCommunityPostTotalCount(startDate: LocalDateTime?, endDate: LocalDateTime?): Int { + val formattedDate = getFormattedDate(useCan.createdAt) + return queryFactory + .select(creatorCommunity.id) + .from(useCan) + .innerJoin(useCan.communityPost, creatorCommunity) + .innerJoin(creatorCommunity.member, member) + .where( + useCan.isRefund.isFalse + .and(useCan.canUsage.eq(CanUsage.PAID_COMMUNITY_POST)) + .and(useCan.createdAt.goe(startDate)) + .and(useCan.createdAt.loe(endDate)) + ) + .groupBy(formattedDate, creatorCommunity.id) + .fetch() + .size + } + fun getCalculateCommunityPostList( startDate: LocalDateTime?, endDate: LocalDateTime?, 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 c233788..f82afed 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 @@ -1,5 +1,6 @@ package kr.co.vividnext.sodalive.admin.calculate +import kr.co.vividnext.sodalive.creator.admin.calculate.GetCreatorCalculateCommunityPostResponse import kr.co.vividnext.sodalive.extensions.convertLocalDateTime import org.springframework.cache.annotation.Cacheable import org.springframework.stereotype.Service @@ -71,12 +72,15 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor endDateStr: String, offset: Long, limit: Long - ): List { + ): GetCreatorCalculateCommunityPostResponse { val startDate = startDateStr.convertLocalDateTime() val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59) - return repository + val totalCount = repository.getCalculateCommunityPostTotalCount(startDate, endDate) + val items = repository .getCalculateCommunityPostList(startDate, endDate, offset, limit) .map { it.toGetCalculateCommunityPostResponse() } + + return GetCreatorCalculateCommunityPostResponse(totalCount, items) } } From cf08d0d4900d692b8471153241e57c8260146a27 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 29 May 2024 00:25:57 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=82=A0=EC=A7=9C=20=EB=B3=80=ED=99=98=20?= =?UTF-8?q?=ED=99=95=EC=9E=A5=ED=95=A8=EC=88=98=20-=20=ED=98=84=EC=9E=AC?= =?UTF-8?q?=20=ED=83=80=EC=9E=84=EC=A1=B4=20=EC=88=98=EC=A0=95=20(ASIA/Seo?= =?UTF-8?q?ul=20->=20Asia/Seoul)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/vividnext/sodalive/extensions/StringExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt b/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt index 3e810b5..b609b75 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/extensions/StringExtensions.kt @@ -12,7 +12,7 @@ fun String.convertLocalDateTime(format: String): LocalDateTime { fun String.convertLocalDateTime( format: String = "yyyy-MM-dd", - currentTimeZoneStr: String = "ASIA/Seoul", + currentTimeZoneStr: String = "Asia/Seoul", hour: Int = 0, minute: Int = 0, second: Int = 0