Skip to content
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

Merged
merged 4 commits into from
Sep 2, 2024

Conversation

YongsHub
Copy link
Contributor

Description

  • 파샤드 패턴으로 로직 리팩토링을 수행했습니다

Core Code

etc

@YongsHub YongsHub added the refactor 비즈니스 변경 없는 수정 label Aug 31, 2024
@YongsHub YongsHub requested a review from lcomment August 31, 2024 09:43
@YongsHub YongsHub self-assigned this Aug 31, 2024
Copy link

Test Results

 40 files  ±0   40 suites  ±0   25s ⏱️ -1s
215 tests ±0  215 ✅ ±0  0 💤 ±0  0 ❌ ±0 
216 runs  ±0  216 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f63f4c5. ± Comparison against base commit e0f0e15.

Copy link

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Impacted file tree graph

@@              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     
Files with missing lines Coverage Δ Complexity Δ
...in/java/com/cakk/api/service/cake/CakeService.java 97.14% <100.00%> (-0.59%) 10.00 <1.00> (-2.00)
...in/java/com/cakk/api/service/shop/ShopService.java 98.59% <ø> (ø) 20.00 <0.00> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0f0e15...f63f4c5. Read the comment docs.

Copy link
Collaborator

@lcomment lcomment left a 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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag에 대한 equals와 hashcode를 overriding 하여 비교하는건 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영하겠습니다!

Copy link
Contributor Author

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 타입 때문에 흠,, 해야 하는 이유가 있을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 제가 잘못 봤네요 ! 필요 없을 것 같습니다

Comment on lines 115 to 117
final Cake cake = cakeReader.findWithCakeTagsAndCakeCategories(cakeId, owner);

cake.removeCakeCategories();
cake.removeCakeTags();
cakeWriter.deleteCake(cake);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 로직을 삭제한 이유는 뭘까요?

Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readOnly를 제거한 이유는 뭘까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인증 정책을 통해 BusinessOwner인증 요청을 보내다보니 엔티티 변경 감지로 Update될 수 있기 때문입니다

Copy link
Collaborator

@lcomment lcomment left a 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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 제가 잘못 봤네요 ! 필요 없을 것 같습니다

@YongsHub YongsHub merged commit 757f811 into develop Sep 2, 2024
3 checks passed
@lcomment lcomment deleted the refactor/CAKK-57 branch September 4, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor 비즈니스 변경 없는 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants