Skip to content

[TAS-505] 랭킹 조회 API#79

Open
S-J-Kim wants to merge 18 commits intodevelopfrom
feature/TAS-505
Open

[TAS-505] 랭킹 조회 API#79
S-J-Kim wants to merge 18 commits intodevelopfrom
feature/TAS-505

Conversation

@S-J-Kim
Copy link
Contributor

@S-J-Kim S-J-Kim commented Feb 21, 2026

PR 체크리스트

Merge 전에 아래 체크리스트가 모두 체크되었는지 확인해주세요

  • 마지막 commit전에 빌드하여 코드 스타일 점검하였나요?
  • 모든 Test 코드를 실행하여 PASS했나요?
  • Swagger 명세를 작성하였나요?
  • 최소 1명의 리뷰와 Approve를 받았나요?

PR 타입

PR의 타입을 체크해주세요

  • 버그 픽스 - 이슈 링크 :
  • 신규 기능 개발
  • 기능 수정
  • 테스트 코드 추가
  • 코드 스타일 업데이트 (formatting, 변수명 수정 등)
  • 리팩토링 (기능 수정은 없고 코드 재사용성을 위한 메서드 분리 등)
  • 설정 파일 수정
  • 기타

백로그 및 이슈 링크

변경된 사항

랭킹 도메인 데이터 구조 수정

  • 랭킹 모델을 ranking_topic (주제) -> ranking_topic_round (회차) -> ranking_entry (순위) 구조로 전환.
  • 랭킹 데이터를 year/month/week에서 round 중심으로 변경 -> FE에서 계산에 의존하지 않고 API에 의존하도록 함.

랭킹 API 개발

  • 랭킹 토픽 목록 조회 API
  • 토픽 별 랭킹 조회 API (토픽의 회차 및 조회할 순위를 파라미터로 받음)
  • 토픽 별 내 랭킹 조회 API (토픽의 회차를 파라미터로 받음)

도메인 구조 UML

classDiagram
    class RankingTopic {
      Long id
      String title
      String description
      Yn isActive
      RankingTopicRound currentRound
    }

    class RankingTopicRound {
      Long id
      Long round
      LocalDateTime rankingAggregationStartDateTime
      LocalDateTime rankingAggregationEndDateTime
      LocalDateTime displayStartDateTime
      LocalDateTime displayEndDateTime
    }

    class RankingEntry {
      Long id
      String memberId
      Long currentRank
      Long previousRank
    }

    RankingTopic "1" --> "0..*" RankingTopicRound : rounds
    RankingTopic "1" --> "0..1" RankingTopicRound : currentRound
    RankingTopicRound "1" --> "0..*" RankingEntry : entries
Loading

기타 전달 사항

@S-J-Kim S-J-Kim requested a review from gyun-ky February 21, 2026 06:01
@S-J-Kim S-J-Kim added Type: Feature 새로운 기능 개발 시 Layer: Domain 도메인 레이어 (Entity)에 연관된 경우 Layer: Presentation 표현 계층(컨트롤러)과 관련된 경우 Layer: Application 애플리케이션 레이어 (Service, Repository)와 연관된 경우 Layer: Infrastructure 인프라스트럭쳐 (DB, 캐시 등의 데이터 영속화) 와 연관된 경우 Type: Test 테스트 코드 작성 시 labels Feb 21, 2026
Copy link
Contributor Author

Choose a reason for hiding this comment

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

기존 엔트리는 회차 정보 + 순위를 모두 가지고 있어서 이것을 분리했습니다.

Copy link
Contributor Author

@S-J-Kim S-J-Kim Feb 21, 2026

Choose a reason for hiding this comment

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

기존에는 year/month/week 기반으로 데이터를 쌓았지만 이 경우에, 랭킹 집계 기간이 변경될때 유연한 대응이 어렵고, week를 FE와 BE에서 모두 계산하여야 한다는 문제가 있어 고정된 기간을 기반으로 동작하도록 리팩토링 해봤습니다

@PathVariable Long topicId, @RequestParam Long round) {
String memberId = AuthUtil.getMemberId();
return ResponseUtil.createSuccessResponse(
RetrieveMyRankingResDto.from(retrieveRankingService.retrieveMyRanking(memberId, topicId, round)));
Copy link
Contributor

Choose a reason for hiding this comment

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

내 랭킹 조회니까 line 55가 서비스 안에 들어가는게 맞을거 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

서비스로 넣고 서비스 메서드 시그니처에 memberId는 제거했습니다.

@Column(name = "round", nullable = false)
private Long round;

@Column(name = "ranking_aggregation_start_at", nullable = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

ranking_aggregation_start_at에는 어떤 값을 넣고 display_start_at에는 어떤 값을 넣나요?

Copy link
Contributor

Choose a reason for hiding this comment

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

답장 부탁드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아 이걸 못봤네요

원래 처음에 Notice 같이 일정 기간동안 조회되도록 하는 속성을 display_start_at/display_end_at 라는 이름으로 넣었습니다. 근데 생각해보니 Round 개념으로 가면 이게 필요가 없을 것 같습니다. 삭제 하겠습니다.

ranking_aggregation_start_at 는 말그대로 랭킹 집계 하는 기간의 시작점입니다~ (배치에서 넣어주는 값)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

display 관련 필드 삭제했습니다.

Copy link
Contributor

@gyun-ky gyun-ky Feb 23, 2026

Choose a reason for hiding this comment

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

필드명 aggregation_start_at / aggregation_end_at으로 간략화하면 어떠할까요? 테이블명있는데 괜히 길어져서요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정했습니다~

@S-J-Kim
Copy link
Contributor Author

S-J-Kim commented Feb 23, 2026

@gyun-ky 리뷰 대응 완료입니다. 확인해서 resolve 해주세요

Round 기준 조회 의미를 반영해 ranking 접두어를 제거하고, 엔티티와 스키마 및 통합 테스트 명칭을 일관되게 맞춘다.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Layer: Application 애플리케이션 레이어 (Service, Repository)와 연관된 경우 Layer: Domain 도메인 레이어 (Entity)에 연관된 경우 Layer: Infrastructure 인프라스트럭쳐 (DB, 캐시 등의 데이터 영속화) 와 연관된 경우 Layer: Presentation 표현 계층(컨트롤러)과 관련된 경우 Type: Feature 새로운 기능 개발 시 Type: Test 테스트 코드 작성 시

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants