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

@@ -29,7 +29,7 @@ class AudioContentCommentController(
) = run {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
service.registerComment(
val commentId = service.registerComment(
comment = request.comment,
audioContentId = request.contentId,
parentId = request.parentId,
@@ -44,6 +44,7 @@ class AudioContentCommentController(
userActionService.recordAction(
memberId = member.id!!,
actionType = ActionType.CONTENT_COMMENT,
commentId = commentId,
pushTokenList = pushTokenList
)
@@ -51,6 +52,7 @@ class AudioContentCommentController(
memberId = member.id!!,
actionType = ActionType.ORDER_CONTENT_COMMENT,
contentId = request.contentId,
commentId = commentId,
pushTokenList = pushTokenList
)
} catch (_: Exception) {

View File

@@ -33,7 +33,7 @@ class AudioContentCommentService(
audioContentId: Long,
parentId: Long? = null,
isSecret: Boolean = false
) {
): Long {
val audioContent = audioContentRepository.findByIdOrNull(id = audioContentId)
?: throw SodaException("잘못된 콘텐츠 입니다.\n다시 시도해 주세요.")
@@ -64,7 +64,7 @@ class AudioContentCommentService(
audioContentComment.parent = parent
}
repository.save(audioContentComment)
val savedContentComment = repository.save(audioContentComment)
applicationEventPublisher.publishEvent(
FcmEvent(
@@ -84,6 +84,8 @@ class AudioContentCommentService(
myMemberId = member.id
)
)
return savedContentComment.id!!
}
@Transactional