Conversation
There was a problem hiding this comment.
기존 엔트리는 회차 정보 + 순위를 모두 가지고 있어서 이것을 분리했습니다.
There was a problem hiding this comment.
기존에는 year/month/week 기반으로 데이터를 쌓았지만 이 경우에, 랭킹 집계 기간이 변경될때 유연한 대응이 어렵고, week를 FE와 BE에서 모두 계산하여야 한다는 문제가 있어 고정된 기간을 기반으로 동작하도록 리팩토링 해봤습니다
...main/java/com/LetMeDoWith/LetMeDoWith/presentation/ranking/controller/RankingController.java
Show resolved
Hide resolved
...main/java/com/LetMeDoWith/LetMeDoWith/presentation/ranking/controller/RankingController.java
Outdated
Show resolved
Hide resolved
| @PathVariable Long topicId, @RequestParam Long round) { | ||
| String memberId = AuthUtil.getMemberId(); | ||
| return ResponseUtil.createSuccessResponse( | ||
| RetrieveMyRankingResDto.from(retrieveRankingService.retrieveMyRanking(memberId, topicId, round))); |
There was a problem hiding this comment.
내 랭킹 조회니까 line 55가 서비스 안에 들어가는게 맞을거 같습니다
There was a problem hiding this comment.
서비스로 넣고 서비스 메서드 시그니처에 memberId는 제거했습니다.
...main/java/com/LetMeDoWith/LetMeDoWith/presentation/ranking/controller/RankingController.java
Outdated
Show resolved
Hide resolved
...ain/java/com/LetMeDoWith/LetMeDoWith/application/ranking/service/RetrieveRankingService.java
Outdated
Show resolved
Hide resolved
| @Column(name = "round", nullable = false) | ||
| private Long round; | ||
|
|
||
| @Column(name = "ranking_aggregation_start_at", nullable = false) |
There was a problem hiding this comment.
ranking_aggregation_start_at에는 어떤 값을 넣고 display_start_at에는 어떤 값을 넣나요?
There was a problem hiding this comment.
아 이걸 못봤네요
원래 처음에 Notice 같이 일정 기간동안 조회되도록 하는 속성을 display_start_at/display_end_at 라는 이름으로 넣었습니다. 근데 생각해보니 Round 개념으로 가면 이게 필요가 없을 것 같습니다. 삭제 하겠습니다.
ranking_aggregation_start_at 는 말그대로 랭킹 집계 하는 기간의 시작점입니다~ (배치에서 넣어주는 값)
There was a problem hiding this comment.
display 관련 필드 삭제했습니다.
There was a problem hiding this comment.
필드명 aggregation_start_at / aggregation_end_at으로 간략화하면 어떠할까요? 테이블명있는데 괜히 길어져서요
|
@gyun-ky 리뷰 대응 완료입니다. 확인해서 resolve 해주세요 |
Round 기준 조회 의미를 반영해 ranking 접두어를 제거하고, 엔티티와 스키마 및 통합 테스트 명칭을 일관되게 맞춘다. Co-authored-by: Cursor <cursoragent@cursor.com>
PR 체크리스트
Merge 전에 아래 체크리스트가 모두 체크되었는지 확인해주세요
PR 타입
PR의 타입을 체크해주세요
백로그 및 이슈 링크
변경된 사항
랭킹 도메인 데이터 구조 수정
ranking_topic (주제) -> ranking_topic_round (회차) -> ranking_entry (순위)구조로 전환.year/month/week에서round중심으로 변경 -> FE에서 계산에 의존하지 않고 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기타 전달 사항