Skip to content

Commit

Permalink
feat: 자기자신에는 알림없어
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jul 26, 2023
1 parent 6ef1e27 commit 4606c1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class UserDiaryService(
DiaryLikeEntity.of(diaryId, userId)
)
diary.likeCount = diaryLikeRepository.countByDiaryId(diaryId).toInt()
notificationService.sendDiaryLikedNotification(diaryId)

if(userId != diary.userId) notificationService.sendDiaryLikedNotification(diaryId)
return diaryRepository.save(diary).toDto()
}
return diary.toDto()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ class NotificationService(
fun sendCommentCreateNotification(comment: DiaryCommentDTO) {
val diary = diaryRepository.findByIdOrNull(comment.diaryId) ?: return
val writer = userRepository.findByIdOrNull(comment.userId) ?: return
sendMessageToUser(
notificationType = NotificationType.SOCIAL,
userId = diary.userId,
description = "${writer.name}님이 내 일기에 댓글을 달았어요!",
routePath = "/comment/${comment.diaryId}"
)
if(comment.userId != diary.userId)
sendMessageToUser(
notificationType = NotificationType.SOCIAL,
userId = diary.userId,
description = "${writer.name}님이 내 일기에 댓글을 달았어요!",
routePath = "/comment/${comment.diaryId}"
)

val taggedPeoples = StringUtils.extractULIDFromString(comment.content)
taggedPeoples.forEach {
Expand Down

0 comments on commit 4606c1f

Please sign in to comment.