[DP-383] 트렌드 랭킹 — Top 5 조회 콘텐츠 + Top 10 태그#54
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
TrendRanker.rank_contents():cur_view_counts기준 기간 조회수 내림차순 Top 5 선정,ContentRepository.find_by_ids()로 상세 조회 (오래된 글도 후보 포함)TrendRanker.rank_tags(): delta + clip(growth_rate) + category_match(α=2) + new_bonus(+0.5) 복합 점수로 Top 10 태그 선정ContentRepository.find_by_ids():ANY(:ids)PostgreSQL 배열 파라미터 기반 다건 조회 메서드 추가cur_contents후보 풀 →cur_view_counts전체 기반으로 변경 (Jira 코멘트 반영)Test plan
pytest tests/test_trend_ranking.py— 7개 (조회수 정렬, view_count=0 포함, view_count 필드, new_bonus, category_match, NaN 안전, score 정렬)pytest tests/test_content_repository.py— find_by_ids 테스트 포함pytest -q전체 391개 통과 확인ruff check . && black --check .통과🤖 Generated with Claude Code