Skip to content

[DP-383] 트렌드 랭킹 — Top 5 조회 콘텐츠 + Top 10 태그#54

Merged
suheon98 merged 1 commit intodevelopV2from
feature/DP-383-trend-ranking
Apr 24, 2026
Merged

[DP-383] 트렌드 랭킹 — Top 5 조회 콘텐츠 + Top 10 태그#54
suheon98 merged 1 commit intodevelopV2from
feature/DP-383-trend-ranking

Conversation

@suheon98
Copy link
Copy Markdown
Collaborator

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

@suheon98 suheon98 merged commit d340570 into developV2 Apr 24, 2026
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.

1 participant