From 56d9a86f7ebfe01e1775d5f7c9e69ead3f6b1b4d Mon Sep 17 00:00:00 2001 From: jeongchanmin Date: Fri, 27 Dec 2024 17:03:51 +0900 Subject: [PATCH] =?UTF-8?q?Refactor=20:=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EB=B6=88=ED=95=84=EC=9A=94=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/LearningSetCompleteEventListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ripple/BE/learning/event/LearningSetCompleteEventListener.java b/src/main/java/com/ripple/BE/learning/event/LearningSetCompleteEventListener.java index 6e3a0b7..076ff5d 100644 --- a/src/main/java/com/ripple/BE/learning/event/LearningSetCompleteEventListener.java +++ b/src/main/java/com/ripple/BE/learning/event/LearningSetCompleteEventListener.java @@ -19,6 +19,11 @@ public class LearningSetCompleteEventListener { private final LearningSetRepository learningSetRepository; private final UserRepository userRepository; + /** + * 사용자 추가 시 학습 세트 추가 이벤트 핸들러 + * + * @param user + */ @Transactional @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void handleLearningSetCompleteEvent(User user) { @@ -34,6 +39,11 @@ public void handleLearningSetCompleteEvent(User user) { userRepository.save(user); } + /** + * 학습 세트 추가 시 사용자에게 학습 세트 배포 이벤트 핸들러 + * + * @param learningSetList + */ @Transactional @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void handleLearningSetCompleteEvent(List learningSetList) { @@ -48,7 +58,5 @@ public void handleLearningSetCompleteEvent(List learningSetList) { .toList(); userList.forEach(user -> user.getLearningSetCompleteList().addAll(learningSetCompletes)); - - // userRepository.saveAll(userList); } }