Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
public record RankingResponse(
Long userId,
String nickname, // 사용자 이름
int rank,
int ranks,
int score
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public class Ranking extends BaseEntity {
@Enumerated(EnumType.STRING)
private RankingType type; // WEEKLY, MONTHLY, ALL_TIME

private int rank;
private int ranks;
private int score;

private LocalDate rankingDate; // 기준 날짜

@Builder
public Ranking(Long userId, RankingType type, int rank, int score, LocalDate rankingDate) {
public Ranking(Long userId, RankingType type, int ranks, int score, LocalDate rankingDate) {
this.userId = userId;
this.type = type;
this.rank = rank;
this.ranks = ranks;
this.score = score;
this.rankingDate = rankingDate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

public interface RankingRepository extends JpaRepository<Ranking, Long> {

List<Ranking> findByTypeAndRankingDateOrderByRankAsc(RankingType type, LocalDate date);
List<Ranking> findByTypeAndRankingDateOrderByRanksAsc(RankingType type, LocalDate date);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public List<RankingResponse> getTopRankings(String key, int limit) {
return RankingResponse.builder()
.userId(userId)
.nickname(nickname)
.rank(rank[0]++)
.ranks(rank[0]++)
.score(tuple.getScore().intValue())
.build();
}).collect(Collectors.toList());
Expand Down