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

[jinyoungchoi95-issue60] Post Article 기능 구현 #61

Merged
merged 28 commits into from Oct 24, 2021

Conversation

jinyoungchoi95
Copy link
Member

Issue: #60

작업 내용

  • Profile 반환 부분 버그 수정
  • Article 도메인 구현
  • Tag 영속성 관련 메소드 추가
  • POST /api/articles

생성/변경 로직

  • Profile 부분에서 잘못 구현된 내용이 있어 수정했습니다. (find할 user의 profile을 반환해야하는데 login user의 profile을 반환하는것을 확인하여 해당 부분 수정되었습니다.)
  • 변경 중 추가로 Profile내에서 follow 여부를 확인할 수 있는 필드를 추가하였습니다. (ProfileModel로 분리하여 반환하게되니 결과적으로 Article에서 사용할 때 클래스가 난잡해져서 이와같이 변경하였습니다.)
  • Tag에서 기존 tag가 있을 경우 repository에서 찾은 tag를 mapping하여 영속성 관리를 통해 Tag Lists가 들어오더라도 기존 tag가 있을 때 따로 save되지 않도록 처리했습니다.

개인 코멘트

  • 생각보다 오래걸렸던 부분인 것 같네요 🤣 Tag를 그냥 저장하게 될 경우에 기존 db에 있는 Tag를 무시하고 unique를 반하게 되어 문제가 생겨서 이를 어떻게하면 깔끔하게 처리할 수 있을까를 고민하게 되었던 것 같아요. 조금 더 나은 방법이 있을 것 같기는한데 지금 상황에서는 현재 구조가 가장 최선으로 보이네요 :)

  • vo 를 효과적으로 사용하기 위해서 계속해서 단위를 쪼개고, 같은 단위를 묶으면서 사용하다보니 vo를 타고가는 vo가 계속해서 생겨나는 것 같아요. 이게 과연 나중에 갔을 때 좋은 구조인지는 다 구현하고 성능 테스트를 진행하면서 확인해보아야할 것 같아요 :)

  • 뭔가 file change가 많기는 한데 사실상 domain이 추가되면서 vo를 많이 쪼개다보니 이렇게 된거같은데, change된 것에 비해 로직 자체는 단순하니 너그럽게 용서해주세요 ㅜㅜ 🙇‍♂️

@jinyoungchoi95 jinyoungchoi95 added feature ori 오리의 이슈 labels Oct 20, 2021
@jinyoungchoi95 jinyoungchoi95 self-assigned this Oct 20, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2021

Codecov Report

Merging #61 (7bf8b80) into jinyoungchoi95 (a6b2ae1) will decrease coverage by 3.07%.
The diff coverage is 84.64%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##             jinyoungchoi95      #61      +/-   ##
====================================================
- Coverage             93.64%   90.57%   -3.08%     
- Complexity              211      289      +78     
====================================================
  Files                    35       47      +12     
  Lines                   535      753     +218     
  Branches                 13       29      +16     
====================================================
+ Hits                    501      682     +181     
- Misses                   16       33      +17     
- Partials                 18       38      +20     
Impacted Files Coverage Δ
.../main/java/com/study/realworld/tag/domain/Tag.java 71.42% <ø> (ø)
.../study/realworld/global/domain/BaseTimeEntity.java 50.00% <50.00%> (ø)
.../com/study/realworld/article/domain/SlugTitle.java 68.75% <68.75%> (ø)
...va/com/study/realworld/article/domain/Article.java 71.42% <71.42%> (ø)
.../java/com/study/realworld/article/domain/Body.java 76.47% <76.47%> (ø)
...om/study/realworld/article/domain/Description.java 77.77% <77.77%> (ø)
.../java/com/study/realworld/article/domain/Slug.java 78.94% <78.94%> (ø)
...study/realworld/article/domain/ArticleContent.java 79.41% <79.41%> (ø)
...java/com/study/realworld/article/domain/Title.java 80.95% <80.95%> (ø)
...ealworld/article/controller/ArticleController.java 100.00% <100.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

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

@kwj1270
Copy link

kwj1270 commented Oct 20, 2021

오늘 코드리뷰 하나 올리고 보겠습니다 🔥

Copy link

@kwj1270 kwj1270 left a comment

Choose a reason for hiding this comment

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

LGTM

@jinyoungchoi95 jinyoungchoi95 merged commit ade24bb into jinyoungchoi95 Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ori 오리의 이슈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants