Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add DateGroupBySupplier example config. #564

Merged
merged 1 commit into from
May 16, 2024
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 @@ -17,7 +17,6 @@
import org.junit.jupiter.api.Test;

import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;

import static org.junit.jupiter.api.Assertions.*;
Expand All @@ -34,7 +33,7 @@ void get() {

@Test
void getYyMm() {
String pattern = "yyMMDD";
String pattern = "yyMMdd";
YearMonthDayGroupBySupplier supplier = new YearMonthDayGroupBySupplier(pattern);
GroupedKey groupedKey = supplier.get();
assertEquals(groupedKey.getKey(), LocalDate.now().format(DateTimeFormatter.ofPattern(pattern)));
Expand Down
26 changes: 25 additions & 1 deletion examples/cosid-example-redis/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,31 @@ cosid:
group_year_biz:
group:
by: year
pattern: yyyy
converter:
type: to_string
to-string:
pad-start: true
char-size: 8
prefix: BIZ-
group-prefix:
enabled: true
group_year_month_biz:
group:
by: year_month
pattern: yyyyMM
converter:
type: to_string
to-string:
pad-start: true
char-size: 8
prefix: BIZ-
group-prefix:
enabled: true
group_year_month_day_biz:
group:
by: year_month_day
pattern: yyyyMMdd
converter:
type: to_string
to-string:
Expand All @@ -96,7 +121,6 @@ cosid:
prefix: BIZ-
group-prefix:
enabled: true

logging:
level:
me.ahoo.cosid: debug
Expand Down
Loading