fix: 유저 행동 데이터에 따른 포인트 지급

- 본인인증을 한 유저만 포인트 정책에 따라 포인트를 지급하도록 수정
This commit is contained in:
Klaus 2025-05-20 00:51:04 +09:00
parent a36d9f02d8
commit d3ec13e6c0
5 changed files with 90 additions and 80 deletions

View File

@ -43,6 +43,7 @@ class AudioContentCommentController(
userActionService.recordAction(
memberId = member.id!!,
isAuth = member.auth != null,
actionType = ActionType.CONTENT_COMMENT,
contentCommentId = commentId,
pushTokenList = pushTokenList
@ -50,6 +51,7 @@ class AudioContentCommentController(
userActionService.recordAction(
memberId = member.id!!,
isAuth = member.auth != null,
actionType = ActionType.ORDER_CONTENT_COMMENT,
contentId = request.contentId,
contentCommentId = commentId,

View File

@ -65,6 +65,7 @@ class MemberController(
userActionService.recordAction(
memberId = response.memberId,
isAuth = false,
actionType = ActionType.SIGN_UP,
pushTokenList = if (request.pushToken != null) {
listOf(request.pushToken)
@ -358,6 +359,7 @@ class MemberController(
if (response.isNew) {
userActionService.recordAction(
memberId = response.memberId,
isAuth = false,
actionType = ActionType.SIGN_UP,
pushTokenList = if (request.pushToken != null) {
listOf(request.pushToken)
@ -393,6 +395,7 @@ class MemberController(
if (response.isNew) {
userActionService.recordAction(
memberId = response.memberId,
isAuth = false,
actionType = ActionType.SIGN_UP,
pushTokenList = if (request.pushToken != null) {
listOf(request.pushToken)

View File

@ -40,6 +40,7 @@ class AuthController(
val pushTokenList = memberService.getPushTokenList(recipient = memberId)
userActionService.recordAction(
memberId = member.id!!,
isAuth = true,
actionType = ActionType.USER_AUTHENTICATION,
pushTokenList = pushTokenList
)

View File

@ -27,6 +27,7 @@ class UserActionController(
val pushTokenList = memberService.getPushTokenList(recipient = memberId)
service.recordAction(
memberId = memberId,
isAuth = member.auth != null,
actionType = request.actionType,
pushTokenList = pushTokenList
)

View File

@ -31,6 +31,7 @@ class UserActionService(
fun recordAction(
memberId: Long,
isAuth: Boolean,
actionType: ActionType,
contentId: Long? = null,
contentCommentId: Long? = null,
@ -49,6 +50,7 @@ class UserActionService(
repository.flush()
}
if (isAuth) {
try {
transactionTemplate.execute {
val policy = policyRepository.findByActionTypeAndIsActiveTrue(actionType, now)
@ -142,6 +144,7 @@ class UserActionService(
}
}
}
}
companion object {
private val logger = LoggerFactory.getLogger(UserActionService::class.java)