-
Notifications
You must be signed in to change notification settings - Fork 1
Issue 1,23 #25
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
Open
HyeonWuJeon
wants to merge
7
commits into
Monday-Rocket:main
Choose a base branch
from
HyeonWuJeon:issue-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Issue 1,23 #25
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5b39420
[issue-1] refactor: add transaction trace log
HyeonWuJeon 8af5a13
[issue-23] refactor: change transaction bean 'javax' to 'springframew…
HyeonWuJeon 68dd6c8
[issue-1] refactor: change logLevel in handleForSignedOutEventListener
HyeonWuJeon 6c820b1
[issue-1] refactor: delete exHandler in handleForSignedOutEventListener
HyeonWuJeon 5d18bc8
[issue-1] refactor: add transactionalOperator in signOut
HyeonWuJeon 01eea11
[issue-1] refactor: change coroutine block 'run' to 'launch'
HyeonWuJeon 3f97569
[issue-1] refactor: publish signOutEvent object in domain
HyeonWuJeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,22 +6,27 @@ import linkpool.user.user.port.`in`.GetUserUseCase | |
| import linkpool.user.user.port.`in`.SignOutUseCase | ||
| import linkpool.user.user.port.out.UserPort | ||
| import linkpool.user.user.port.out.UserEventPublishPort | ||
| import linkpool.user.user.model.UserSignedOutEvent | ||
|
|
||
| import javax.transaction.Transactional | ||
| import org.springframework.transaction.annotation.Transactional | ||
| import org.springframework.transaction.reactive.TransactionalOperator | ||
| import org.springframework.transaction.reactive.executeAndAwait | ||
|
|
||
| @DomainComponent | ||
| @Transactional | ||
| class SignOutService( | ||
| private val getUserUseCase: GetUserUseCase, | ||
| private val userPort: UserPort, | ||
| private val userEventPublishPort: UserEventPublishPort | ||
| private val userEventPublishPort: UserEventPublishPort, | ||
| private val transactionalOperator: TransactionalOperator | ||
| ): SignOutUseCase { | ||
|
|
||
| override suspend fun signOut(userId: Long) { | ||
| val user = getUserUseCase.getById(userId) | ||
| user.signOut() | ||
| userPort.patch(user) | ||
| userEventPublishPort.publishUserSignedOutEvent(UserSignedOutEvent(user.id)) | ||
| transactionalOperator.executeAndAwait { | ||
| val user = getUserUseCase.getById(userId) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Hee-jin506 님, 의견주신대로 코드 수정하여 반영했습니다. |
||
| val event = user.signOut() | ||
| userPort.patch(user) | ||
| event | ||
| }?.let { | ||
| userEventPublishPort.publishUserSignedOutEvent(it) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
'reactive transcation'을 제어하기위한 오퍼레이터 입니다.
콜백접근 방식과 코루틴 연산자를 제공하여 해당 연산자를 채택하였습니다.
'ReactiveTransactionManager'는 반드시 Mono, Flux 등의 reactor 연산자를 제공해야 합니다.
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.
UserSignedOutEvent 생성 하는 영역을 User 애그리거트 안쪽으로 옮겨서 User 애그리거트에게 이벤트 생성 책임을 지우면 어떨까요?
참고: https://www.baeldung.com/spring-data-ddd
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.
좋은의견 감사합니다!
회원탈퇴에 의해 발생된 '이벤트 발행 객체'가 오로지 User 애그리거트에게 책임을 지울수있는 형태이니 의견주신 디자인을 적용해도 괜찮은 것 같습니다.