test #426
@@ -39,14 +39,12 @@ class AudioContentCommentController(
|
|||||||
try {
|
try {
|
||||||
userActionService.recordAction(
|
userActionService.recordAction(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
isAuth = member.auth != null,
|
|
||||||
actionType = ActionType.CONTENT_COMMENT,
|
actionType = ActionType.CONTENT_COMMENT,
|
||||||
contentCommentId = commentId
|
contentCommentId = commentId
|
||||||
)
|
)
|
||||||
|
|
||||||
userActionService.recordAction(
|
userActionService.recordAction(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
isAuth = member.auth != null,
|
|
||||||
actionType = ActionType.ORDER_CONTENT_COMMENT,
|
actionType = ActionType.ORDER_CONTENT_COMMENT,
|
||||||
contentId = request.contentId,
|
contentId = request.contentId,
|
||||||
contentCommentId = commentId
|
contentCommentId = commentId
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class UserActionController(private val service: UserActionService) {
|
|||||||
|
|
||||||
service.recordAction(
|
service.recordAction(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
isAuth = member.auth != null,
|
|
||||||
actionType = request.actionType
|
actionType = request.actionType
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import kotlinx.coroutines.launch
|
|||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import kr.co.vividnext.sodalive.content.order.Order
|
import kr.co.vividnext.sodalive.content.order.Order
|
||||||
import kr.co.vividnext.sodalive.content.order.OrderRepository
|
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.MemberPoint
|
||||||
import kr.co.vividnext.sodalive.point.MemberPointRepository
|
import kr.co.vividnext.sodalive.point.MemberPointRepository
|
||||||
import kr.co.vividnext.sodalive.point.PointGrantLog
|
import kr.co.vividnext.sodalive.point.PointGrantLog
|
||||||
@@ -26,7 +27,8 @@ class UserActionService(
|
|||||||
private val policyRepository: PointRewardPolicyRepository,
|
private val policyRepository: PointRewardPolicyRepository,
|
||||||
private val grantLogRepository: PointGrantLogRepository,
|
private val grantLogRepository: PointGrantLogRepository,
|
||||||
private val memberPointRepository: MemberPointRepository,
|
private val memberPointRepository: MemberPointRepository,
|
||||||
private val transactionTemplate: TransactionTemplate
|
private val transactionTemplate: TransactionTemplate,
|
||||||
|
private val authRepository: AuthRepository
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val coroutineScope = CoroutineScope(
|
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
|
@PreDestroy
|
||||||
fun onDestroy() {
|
fun onDestroy() {
|
||||||
coroutineScope.cancel("UserActionService 종료")
|
coroutineScope.cancel("UserActionService 종료")
|
||||||
|
|||||||
Reference in New Issue
Block a user