File tree Expand file tree Collapse file tree
apps/commerce-api/src/main/java/com/loopers/domain/ranking Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .loopers .domain .ranking ;
2+
3+ import java .time .LocalDate ;
4+ import java .time .format .DateTimeFormatter ;
5+
6+ /**
7+ * Redis ZSET 키 생성 유틸리티
8+ */
9+ public class RankingKey {
10+
11+ private static final String KEY_PREFIX = "ranking:all:" ;
12+ private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter .ofPattern ("yyyyMMdd" );
13+
14+ private RankingKey () {
15+ }
16+
17+ public static String daily (LocalDate date ) {
18+ return KEY_PREFIX + date .format (DATE_FORMATTER );
19+ }
20+
21+ public static String today () {
22+ return daily (LocalDate .now ());
23+ }
24+
25+ public static String fromDateString (String dateString ) {
26+ return KEY_PREFIX + dateString ;
27+ }
28+
29+ public static LocalDate parseDate (String dateString ) {
30+ return LocalDate .parse (dateString , DATE_FORMATTER );
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments