test #426
@@ -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
|
||||
|
||||
@@ -21,7 +21,6 @@ class UserActionController(private val service: UserActionService) {
|
||||
|
||||
service.recordAction(
|
||||
memberId = member.id!!,
|
||||
isAuth = member.auth != null,
|
||||
actionType = request.actionType
|
||||
)
|
||||
|
||||
|
||||
@@ -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 종료")
|
||||
|
||||
Reference in New Issue
Block a user