fix: 콘텐츠 댓글 작성시 유저 행동 데이터에 댓글 ID를 같이 기록하도록 수정

This commit is contained in:
2025-05-19 15:05:31 +09:00
parent fe84292483
commit 6df043dfac
4 changed files with 17 additions and 5 deletions

View File

@@ -9,5 +9,6 @@ import javax.persistence.Enumerated
data class UserActionLog(
val memberId: Long,
@Enumerated(EnumType.STRING)
val actionType: ActionType
val actionType: ActionType,
val commentId: Long? = null
) : BaseEntity()

View File

@@ -33,12 +33,19 @@ class UserActionService(
memberId: Long,
actionType: ActionType,
contentId: Long? = null,
commentId: Long? = null,
pushTokenList: List<String> = emptyList()
) {
coroutineScope.launch {
val now = LocalDateTime.now()
transactionTemplate.execute {
repository.save(UserActionLog(memberId, actionType))
repository.save(
UserActionLog(
memberId = memberId,
actionType = actionType,
commentId = commentId
)
)
repository.flush()
}