From 64a63fa8faca5362adc17e09a2c6346f3856b741 Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 1 Nov 2023 12:42:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EC=A3=BC?= =?UTF-8?q?=EB=AC=B8=20-=20=EB=8C=80=EC=97=AC=EB=A7=8C=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=9C=20=EC=BD=98=ED=85=90=EC=B8=A0=EC=9D=98=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EC=86=8C=EC=9E=A5=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EC=9D=B4=20=EB=93=A4=EC=96=B4=EC=98=A4?= =?UTF-8?q?=EB=8D=94=EB=9D=BC=EB=8F=84=20=EB=8C=80=EC=97=AC=EB=A1=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/vividnext/sodalive/content/order/OrderService.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt index e16f567..2e42cdc 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt @@ -27,10 +27,15 @@ class OrderService( ) { @Transactional fun order(contentId: Long, orderType: OrderType, container: String, member: Member) { - val order = Order(type = orderType) val content = audioContentRepository.findByIdAndActive(contentId) ?: throw SodaException("잘못된 콘텐츠 입니다\n다시 시도해 주세요.") + val order = if (content.isOnlyRental) { + Order(type = OrderType.RENTAL) + } else { + Order(type = orderType) + } + if (member.id!! == content.member!!.id!!) throw SodaException("자신이 올린 콘텐츠는 구매할 수 없습니다.") if (repository.isExistOrdered(memberId = member.id!!, contentId = contentId)) { throw SodaException("이미 구매한 콘텐츠 입니다.") -- 2.40.1