-
Notifications
You must be signed in to change notification settings - Fork 1
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
ERD 기반 Entity 생성 #21 #24
Merged
Merged
Conversation
This file contains 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
@binary-ho 님 고생하셨습니다!😊 한 가지 말씀드리자면 kotlin은 final class가 기본이라 Lazy Loding을 사용하려면 추가 설정이 조금 필요한 걸로 알고 있는데요. 자세한 내용은 아래 글로 대신하겠습니다! |
@egg526 헉 알려주셔서 감사합니다 ㅠㅠ 아직 많이 미숙하네요 적용해보겠습니다. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
일단 ERD 기반으로 간단하게 만들어 보았습니다.
나름 고민이 많았는데, 시간의 압박이 있어 일단 만들고 API를 만드는 과정에서 고쳐나갈까 합니다.
1. 구현
- email과 userName은 unique하고, nickname은 unique 하지 않은 점.
- nvarchar로 저장하기 위한 @Nationalized 추가
2. 고민한 부분들....
저장 방식이 imageURL일지, SVG일지 물리적인 파일 경로일지 정해지지 않았기 떄문에 일단은 Wrapping하는 Embeded 객체를 만들고 stickerImage로 이름을 지었으나, 좋은 구현인지는 고민입니다.
이유는 Task CRUD시 요청을 보내온 유저와 (시큐리티 Context에 박힌 유저) 실제 Task의 소유자가 같은 사람인지 비교하는 과정을 넣을 것 같은데, 그 과정에서 결국 어떻게든 DB의 User데이터가 필요하기 떄문에 차라리 바로 가져오면 어떨까 생각했습니다. 좋은 구현인지는 모르겠습니다.
사실 Goal에서 Task List가 필요한 상황이 있는지 아직 모르겠고, 있는지 모르겠다면 안 만드는 것이 맞는데, MVP 1에 목표 삭제가 포함되어 있기 때문에, 간단하게 삭제 전이를 구현하기 위해 넣었습니다.
대신 fetch를 LAZY하게 설정해 매번 가져오지 않게 구현했습니다.. 탈퇴는 MVP 1에 없기 때문에 User와 Goal의 삭제 전이는 아직 설정되어 있지 않습니다.
이후 시간이 된다면 Tag나 Emoji의 삭제에 대한이야기나, 삭제 방식 (soft, hard)에 대해서도 이야기 해보면 좋을 것 같습니다.