-
Notifications
You must be signed in to change notification settings - Fork 1
[Feat] #586 - default User 생성 api 구현 #587
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
48b3365
[#586] feat: other에 유저 생성 경로 추가
jher235 5028735
[#586] feat: 내부 API Key가 유효하지 않은 경우 예외 추가
jher235 5aa8525
[#586] feat: 유저 생성 api dto 작성
jher235 58804d2
[#586] feat: 유저 생성 로직 구현
jher235 074ca2e
[#586] feat: 유저 생성 presentation 작성
jher235 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package org.sopt.app.application.user; | ||
|
|
||
| public record UserInfo (Long userId){ | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
저번에 재헌님이랑 대화해보면서 나오기도 했었던 읽기/쓰기와 관련해서 코멘트 남깁니다
제가 코멘트 남긴 부분의
createUser메서드 처럼 (이번에 추가된 메서드가 아닌 기존 메서드도 동일)Facade패턴에서UserFacade내부에서 트랜잭션을 잡아주고 있는 구조로 이해했어요또
application/user/UserService에서도 @transactional 으로 설정되어 있는 구조로 이해했는데," 실제 쓰기 트랜잭션만 서비스에 두고 파사드/컨트롤러는 읽기에 집중 " 시키는거는 어떨까라는 생각이 들었습니다
저도 파사드 패턴에 대해서는 자세하게 알지 못하지만,
Facade자체에서도 트랜잭션을 잡아주게 되면서 생기는 사이드 이펙트는 없을까 ? 라는 생각에서 시작된 궁금증이였어요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.
제가 생각했을 땐 파사드 패턴이 현재는 도메인별 서비스를 가져와서 사용하는 구조이다보니 트랜잭션을 설정할 수 밖에 없는 것 같아요. 지훈님이 말씀하신 실제 쓰기 트랜잭션만 서비스에 둔다는게 @transactional 을 서비스에만 걸어준다는 방식으로 이해했는데 이게 맞을까요??
이런 식으로 @transactional 룰을 정하면 어떤 이점이 있다고 생각하셨을까요?
제 개인적인 생각으론 필요에 따라서 @transactional 을 설정하는게 바람직한 것 같아요. 사실 지금 구조는 단순 save 메서드만 호출하는 구조이기 때문에 @transactional을 호출하지 않아도 SimplaJpaRepo에서 자동으로 트랜잭션을 걸어주지만, "추후 기능적 확장을 고려했을 때 해당 메서드에 @transactional을 걸어주는게 좋겠다"라는 생각이었습니다. 만약 다른 정보를 가져와서 함께 유저에게 저장해준다던가, 다른 정보도 함께 수정된다던가 할 때는 결국 작업의 원자성을 보장하기 위해서 @transactional을 파사드단에서도 걸어주는게 필요하다는 입장입니다.
혹시 지훈님이 걱정하시는 사이드 이펙트는 어떤 게 있을까요??