PR #32 리뷰반영 - 게시글 파싱 로직 수정 #42
Merged
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.
🔑 Key Changes
👩💻 To Reviewers
변경된 RSS 파싱 및 저장 로직 Sequence Diagram
sequenceDiagram participant Schedule participant PostCollectService participant RssPostParser participant RssItemResource participant PostEntity participant PostEntityJpaRepository Schedule ->> PostCollectService: collectPosts(): 10분마다 게시글 수집 activate PostCollectService loop 저장된 구독 블로그 수 만큼 반복 PostCollectService ->>+ RssPostParser: parseRssDocuments(): RSS XML 문서 파싱 loop 파싱한 블로그 포스트 수 만큼 반복 RssPostParser ->>+ RssItemResource: <<create>> RssItemResource -->>- RssPostParser: 파싱 결과 생성: RssItemResource end RssPostParser -->>- PostCollectService: 파싱 결과 리스트 생성: List<RssItemResource> PostCollectService ->>+ PostEntityJpaRepository: findAllBySubscribeOrderByPubDateDesc(): 저장된 게시글 목록 조회() PostEntityJpaRepository -->>- PostCollectService: 저장된 게시글 목록 반환: List<PostEntity> PostCollectService ->>+ PostCollectService: convertListToHashSet(): PostEntity 리스트를 HashMap으로 변환 loop 파싱한 블로그 포스트 수 만큼 반복 alt 기존 게시글에 존재하는 글일 경우 rect rgb(255, 255, 204) PostCollectService ->>+ PostEntity: update(): 엔티티 업데이트 PostEntity -->>- PostCollectService: 엔티티 업데이트 완료 PostCollectService ->>+ PostEntityJpaRepository: save(): 게시글 업데이트 end else 기존 게시글에 존재하지 않는 새로운 글일 경우 rect rgb(255, 255, 204) PostCollectService ->>+ PostEntity: <<create>> PostEntity -->>- PostCollectService: 새로운 게시글 엔티티 생성: PostEntity PostCollectService ->>+ PostEntityJpaRepository: save(): 게시글 저장 end end end end deactivate PostCollectService변경사항 1: 기존에 존재하는 게시글인지 확인하는 로직
변경사항 2: 기존에 존재하던 게시글일 경우에도 DB에 업데이트하도록 변경
Fixture 이렇게 만드는거 맞나요?? 이게 더 쓰기 편한지는 아직 의문입니다. 제가 잘못 만든건지...
🎯 쿼리 튜닝 : existsBySubscribeAndGuid() #35 ㅠㅠ 로직이 바꿔어서 테스트하지 못하게 되었다 ㅠㅠ
Related to