-
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 | CAKK-57 | 케이크 도메인 로직 리팩토링 #203
Conversation
YongsHub
commented
Aug 31, 2024
- 파샤드 패턴으로 로직 리팩토링을 수행했습니다
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #203 +/- ##
=============================================
- Coverage 93.31% 92.11% -1.21%
+ Complexity 333 329 -4
=============================================
Files 109 109
Lines 973 964 -9
Branches 34 34
=============================================
- Hits 908 888 -20
- Misses 47 57 +10
- Partials 18 19 +1
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
고생하셨습니다!
return tagNames.stream() | ||
.map(tagName -> tags | ||
.stream() | ||
.filter(tag -> tag.getTagName().equals(tagName)) |
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.
tag에 대한 equals와 hashcode를 overriding 하여 비교하는건 어떨까요?
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.
반영하겠습니다!
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.
@lcomment 근데 이 부분은 tagName:String 타입과 tag: Tag 타입 때문에 흠,, 해야 하는 이유가 있을까요?
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.
아 제가 잘못 봤네요 ! 필요 없을 것 같습니다
final Cake cake = cakeReader.findWithCakeTagsAndCakeCategories(cakeId, owner); | ||
|
||
cake.removeCakeCategories(); | ||
cake.removeCakeTags(); | ||
cakeWriter.deleteCake(cake); |
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.
해당 로직을 삭제한 이유는 뭘까요?
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.
orphanremoval 옵션이 작동하고 있기 때문에 필요 없는 로직이 되었습니다
@@ -121,7 +121,7 @@ public CakeShopByMineResponse getMyBusinessId(final User user) { | |||
return ShopMapper.supplyCakeShopByMineResponseBy(result); | |||
} | |||
|
|||
@Transactional(readOnly = true) | |||
@Transactional |
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.
readOnly를 제거한 이유는 뭘까요?
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.
인증 정책을 통해 BusinessOwner인증 요청을 보내다보니 엔티티 변경 감지로 Update될 수 있기 때문입니다
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.
고생하셨습니다 !
return tagNames.stream() | ||
.map(tagName -> tags | ||
.stream() | ||
.filter(tag -> tag.getTagName().equals(tagName)) |
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.
아 제가 잘못 봤네요 ! 필요 없을 것 같습니다