From 36b8e8169ebaed357b02ceb497bb21b627d8be55 Mon Sep 17 00:00:00 2001 From: Klaus Date: Mon, 19 May 2025 16:27:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9C=A0=EC=A0=80=20=ED=96=89=EB=8F=99?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A7=80=EA=B8=89=20-=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=EA=B0=80=20=EC=A7=80=EA=B8=89=20=EB=B0=9B?= =?UTF-8?q?=EC=9D=84=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=EA=B0=80=200=20?= =?UTF-8?q?=EC=9D=B4=EC=83=81=EC=9D=B8=20=EA=B2=BD=EC=9A=B0=EC=97=90?= =?UTF-8?q?=EB=A7=8C=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=A7=80=EA=B8=89=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EB=A5=BC=20=EB=82=A8=EA=B8=B0=EA=B3=A0=20?= =?UTF-8?q?=ED=91=B8=EC=8B=9C=20=EB=B0=9C=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/useraction/UserActionService.kt | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt index 4ef7092..11697a6 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt @@ -102,42 +102,38 @@ class UserActionService( ) if (grantedCount >= policy.availableCount) return@execute - grantLogRepository.save( - PointGrantLog( - memberId = memberId, - point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) { - order.can - } else { - policy.pointAmount - }, - actionType = actionType, - policyId = policy.id!!, - orderId = order?.id - ) - ) + val point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) { + order.can + } else { + policy.pointAmount + } - memberPointRepository.save( - MemberPoint( - memberId = memberId, - point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) { - order.can - } else { - policy.pointAmount - }, - actionType = actionType, - expiresAt = now.plusDays(3) + if (point > 0) { + grantLogRepository.save( + PointGrantLog( + memberId = memberId, + point = point, + actionType = actionType, + policyId = policy.id!!, + orderId = order?.id + ) ) - ) - if (pushTokenList.isNotEmpty()) { - fcmService.sendPointGranted( - pushTokenList, - if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) { - order.can - } else { - policy.pointAmount - } + memberPointRepository.save( + MemberPoint( + memberId = memberId, + point = point, + actionType = actionType, + expiresAt = now.plusDays(3) + ) ) + + if (pushTokenList.isNotEmpty()) { + fcmService.sendPointGranted( + pushTokenList, + point + ) + } } } }