fix(user-action): 리워드 인증 여부를 서비스에서 조회한다

This commit is contained in:
2026-06-19 05:35:32 +09:00
parent be6f324fb1
commit 07b93f3219
3 changed files with 18 additions and 4 deletions

View File

@@ -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

View File

@@ -21,7 +21,6 @@ class UserActionController(private val service: UserActionService) {
service.recordAction(
memberId = member.id!!,
isAuth = member.auth != null,
actionType = request.actionType
)

View File

@@ -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 종료")