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

[FEAT] 오늘 인기작 조회 기능 구현 #115

Merged
merged 30 commits into from
Aug 5, 2024
Merged

[FEAT] 오늘 인기작 조회 기능 구현 #115

merged 30 commits into from
Aug 5, 2024

Conversation

Kim-TaeUk
Copy link
Contributor

@Kim-TaeUk Kim-TaeUk commented Jul 26, 2024

Related Issue

Key Changes

  • 스케쥴링
    • 매일 00시에 인기작품을 스케쥴링하고 PopularNovel에 갱신합니다.
  • response
    • 인기작품(novel)마다, 대응하는 피드글(feed)과 피드글의 작성자 아바타에 해당하는 아바타(avatar)를 한 프로퍼티에 내려주기 위해 Map을 사용했습니다.

To Reviewers

  • RecentUserNovel -> PopularNovel 변경되었습니다.
  • 차단 관계에 있는 유저의 피드글은 인기작과 같이 보여지는 피드에 띄워지면 안되는데, 요구사항에 맞는 쿼리 자체가 너무 복잡해질 것 같아서 일단 제외했습니다. 그리고 인기작에 같이 뜨는 피드글 자체가 정책 상 좋아요를 가장 많이 받은 글이기도 해서 기획에 한 번 물어보겠습니다!

ReadStatus가 WATCHING이거나 WATCHED이고, isInterest가 true인 novelId를 내림차순으로 30개(Pageable로 30개 지정)
매일 00시마다 userNovelRepository에서 오늘의 인기작에 해당하는 작품을 30개씩 recentUserNovelRepository에 save
'최근 7일 동안' 조건이 빠져서 추가
전 날 스케쥴링을 통해 얻은 인기 작품들을 영속성 컨텍스트에 올려 두고,
오늘 스케쥴링을 통해 얻은 인기 작품들을 saveAll 한 뒤에 deleteAll 하는 방식
10개보다 많을 때는 랜덤 10개 추출,
10개보다 적을 때는 모두 추출
feed null check 안해주면 feed.getUser()에서 NPE 터짐
-> novel에 해당하는 feed가 없는 경우!
novelId에 해당하는 feed 객체가 null인 경우 filter
-> novel에 해당하는 feed가 없는 경우에 NPE 발생하기 때문
@Kim-TaeUk Kim-TaeUk marked this pull request as draft July 26, 2024 10:46
@Kim-TaeUk Kim-TaeUk marked this pull request as ready for review July 26, 2024 16:14
Copy link
Member

@ChaeAg ChaeAg left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!
코멘트 하나만 확인 부탁드려요!

@ChaeAg ChaeAg self-requested a review July 29, 2024 07:21
@Kim-TaeUk Kim-TaeUk marked this pull request as draft August 1, 2024 23:50
@Kim-TaeUk Kim-TaeUk marked this pull request as ready for review August 4, 2024 08:26
Copy link
Contributor

@rinarina0429 rinarina0429 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!! 리뷰 한번만 확인해주세요~

Copy link
Member

@ChaeAg ChaeAg left a comment

Choose a reason for hiding this comment

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

굿! 코멘트 반영된 것 확인했습니다!
수고하셨습니다~!

from popularNovelIds to novelIdsFromPopularNovel
from selectedPopularNovelIds to selectedNovelIdsFromPopularNovel
Copy link
Contributor

@rinarina0429 rinarina0429 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~!!

@Kim-TaeUk Kim-TaeUk merged commit 879359c into dev Aug 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 오늘 인기작 조회 기능 구현
3 participants