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] 유저 작품 취향 조회 기능 구현 #149

Merged
merged 15 commits into from
Aug 26, 2024
Merged

[FEAT] 유저 작품 취향 조회 기능 구현 #149

merged 15 commits into from
Aug 26, 2024

Conversation

Kim-TaeUk
Copy link
Contributor

Related Issue

Key Changes

  • 유저가 등록한 userNovel에 해당하는 attractivePoint와 keyword의 취향을 조회하는 api입니다.
  • userNovel 리포지토리에서 user에 해당하는 userNovel을 조회하여 가공합니다.
    • attractivePoint의 경우 상위 3개(최대 3개)만 내려줍니다.
    • keyword 많이 선택한 키워드 순으로 내려줍니다.
    • 자세한 로직은 코멘트 추가했습니다.

To Reviewers

  • 많이 선택한 키워드 순으로 내려주기 위해 LinkedHashMap을 사용했습니다.

조회한 owner에 해당하는 userNovels의 userNovelAttractivePoint를 flatMap으로 평탄화,
 userNovelAttractivePoint에서 attractivePoint get,
 attractivePointName으로 groupBy하여 count와 key-value로 map 생성
Entry.comparingByValue를 통해 내림차순 정렬,
limit로 상위 3개 조회,
getKey로 attractivePointName만 추출
조회한 owner에 해당하는 userNovels의 userNovelKeywords를 flatMap으로 평탄화,
userNovelKeyword에서 keyword get,
keywordName으로 groupBy하여 count와 key-value로 map 생성
Entry.comparingByValue를 통해 내림차순 정렬
(e1, e2) -> e1으로 key값 충돌 방지: 실제로 충돌이 발생하지는 않지만 toMap의 필수 파라미터
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.

궁금한 점이 있어 코멘트 하나만 남겨두었습니다!!
ㅎㅎ 수고많으셨어요!!

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.

수고하셨습니당~! 👍

@Kim-TaeUk Kim-TaeUk merged commit e1b5efa into dev Aug 26, 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