From ff10a9935b728e7226328e993272f6b7e00d6384 Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 19 Sep 2023 12:21:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EB=A3=8C=EB=9D=BC=EC=9D=B4=EB=B8=8C?= =?UTF-8?q?=20-=2010=EC=BA=94=20=EC=9D=B4=EC=83=81=20=EB=B6=80=ED=84=B0=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/live/room/LiveRoomService.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt index e79a7e0..2d86b53 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt @@ -190,13 +190,21 @@ class LiveRoomService( throw SodaException("방 입장 비밀번호 6자리를 입력해 주세요.") } + if (request.price in 1..9) { + throw SodaException("유료라이브는 10캔부터 설정 가능 합니다.") + } + val room = LiveRoom( title = request.title, notice = request.content, beginDateTime = beginDateTime, numberOfPeople = request.numberOfPeople, isAdult = request.isAdult, - price = request.price, + price = if (request.price < 0) { + 0 + } else { + request.price + }, type = request.type, password = request.password ) @@ -456,9 +464,9 @@ class LiveRoomService( charge.useCan = useCan when (it.paymentGateway) { - PaymentGateway.PG -> booker.pgRewardCan += charge.rewardCan PaymentGateway.GOOGLE_IAP -> booker.googleRewardCan += charge.rewardCan PaymentGateway.APPLE_IAP -> booker.appleRewardCan += charge.rewardCan + else -> booker.pgRewardCan += charge.rewardCan } charge.member = booker @@ -922,9 +930,9 @@ class LiveRoomService( charge.useCan = useCan when (it.paymentGateway) { - PaymentGateway.PG -> donator.pgRewardCan += charge.rewardCan PaymentGateway.GOOGLE_IAP -> donator.googleRewardCan += charge.rewardCan PaymentGateway.APPLE_IAP -> donator.appleRewardCan += charge.rewardCan + else -> donator.pgRewardCan += charge.rewardCan } charge.member = donator