Skip to content

Commit

Permalink
refactor: 키워드 답장 편지 작성 시, 답장 대상에게 알림 전송
Browse files Browse the repository at this point in the history
  • Loading branch information
hgh1472 committed Dec 8, 2024
1 parent b8c2acf commit 2d0f74e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package postman.bottler.letter.service;

import static postman.bottler.notification.domain.NotificationType.KEYWORD_REPLY;

import java.util.List;
import java.util.Objects;
import lombok.RequiredArgsConstructor;
Expand All @@ -19,6 +21,7 @@
import postman.bottler.letter.exception.DuplicateReplyLetterException;
import postman.bottler.letter.exception.LetterAuthorMismatchException;
import postman.bottler.letter.exception.LetterNotFoundException;
import postman.bottler.notification.service.NotificationService;
import postman.bottler.reply.dto.ReplyType;

@Service
Expand All @@ -28,6 +31,7 @@ public class ReplyLetterService {
private final ReplyLetterRepository replyLetterRepository;
private final LetterService letterService;
private final LetterBoxService letterBoxService;
private final NotificationService notificationService;
private final RedisTemplate<String, Object> redisTemplate;

@Transactional
Expand All @@ -46,6 +50,8 @@ public ReplyLetterResponseDTO createReplyLetter(

saveLetterToBox(senderId, replyLetter, receiverId);
saveRecentReply(letterId, letterReplyRequestDTO.label(), receiverId);
notificationService.sendNotification(KEYWORD_REPLY, receiverInfo.receiverId(), replyLetter.getLetterId(),
replyLetter.getLabel());
return ReplyLetterResponseDTO.from(replyLetter);
}

Expand Down

0 comments on commit 2d0f74e

Please sign in to comment.