-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor #104] 알림 생성 API Refactor #105
Conversation
Code Coverage
|
Test Results 23 files 23 suites 12s ⏱️ Results for commit e21637b. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생많으셨습니다~
Notification notification = Notification.of(type, targetId, triggerMemberId, toMember); | ||
@EventListener | ||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) | ||
@Transactional(propagation = Propagation.REQUIRES_NEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
찾아보니까 두 어노테이션의 성격이 상반된 것 같은데 같이 사용하면 어떻게 동작하는지 궁금합니다!
- EventListener: 트랜잭션에 의존하지 않고, 이벤트 발생 시 즉시 처리
- TransactionalEventListener: 트랜잭션 결과에 따라 이벤트 처리
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인해보니 중복 어노테이션을 작성했었네요.
잘 몰랐던 부분인데 짚어주셔서 감사합니다!
src/main/java/com/dnd/gongmuin/notification/service/NotificationService.java
Show resolved
Hide resolved
Long targetId, | ||
Long triggerMemberId, | ||
Member toMember | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개인적으로 toMember를 targetMember로 네이밍해도 좋을 것 같아요!
관련 이슈
📑 작업 상세 내용
💫 작업 요약
🔍 중점적으로 리뷰 할 부분