diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/comment/AudioContentCommentController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/comment/AudioContentCommentController.kt index 1f91f63f..7f2b8af5 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/comment/AudioContentCommentController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/comment/AudioContentCommentController.kt @@ -39,14 +39,12 @@ class AudioContentCommentController( try { userActionService.recordAction( memberId = member.id!!, - isAuth = member.auth != null, actionType = ActionType.CONTENT_COMMENT, contentCommentId = commentId ) userActionService.recordAction( memberId = member.id!!, - isAuth = member.auth != null, actionType = ActionType.ORDER_CONTENT_COMMENT, contentId = request.contentId, contentCommentId = commentId diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionController.kt index 100d5252..a7489581 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionController.kt @@ -21,7 +21,6 @@ class UserActionController(private val service: UserActionService) { service.recordAction( memberId = member.id!!, - isAuth = member.auth != null, actionType = request.actionType ) 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 b45f783a..44a22e05 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/useraction/UserActionService.kt @@ -8,6 +8,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import kr.co.vividnext.sodalive.content.order.Order import kr.co.vividnext.sodalive.content.order.OrderRepository +import kr.co.vividnext.sodalive.member.auth.AuthRepository import kr.co.vividnext.sodalive.point.MemberPoint import kr.co.vividnext.sodalive.point.MemberPointRepository import kr.co.vividnext.sodalive.point.PointGrantLog @@ -26,7 +27,8 @@ class UserActionService( private val policyRepository: PointRewardPolicyRepository, private val grantLogRepository: PointGrantLogRepository, private val memberPointRepository: MemberPointRepository, - private val transactionTemplate: TransactionTemplate + private val transactionTemplate: TransactionTemplate, + private val authRepository: AuthRepository ) { private val coroutineScope = CoroutineScope( @@ -160,6 +162,21 @@ class UserActionService( } } + fun recordAction( + memberId: Long, + actionType: ActionType, + contentId: Long? = null, + contentCommentId: Long? = null + ) { + recordAction( + memberId = memberId, + isAuth = authRepository.getAuthIdByMemberId(memberId) != null, + actionType = actionType, + contentId = contentId, + contentCommentId = contentCommentId + ) + } + @PreDestroy fun onDestroy() { coroutineScope.cancel("UserActionService 종료")