Skip to content

v2.8.0

Compare
Choose a tag to compare
@Ahoo-Wang Ahoo-Wang released this 16 May 09:43
· 153 commits to main since this release
65b5abb

What's Changed

  • fix(deps): update dependency me.ahoo.cosid:cosid-bom to v2.6.9 by @renovate in #562
  • feat: support YearGroupBySupplier / YearMonthGroupBySupplier / YearMonthDayGroupBySupplier. by @Ahoo-Wang in #563
  • feat: add DateGroupBySupplier example config. by @Ahoo-Wang in #564
  • feat(doc): Update specific-id.md by @Ahoo-Wang in #565

YearGroupBySupplier

使用 SegmentId 算法,要求输出的ID字符串:

  • 起始序号:0
  • 格式:<prefix><year><sequence>
  • 分组:按年分组,每年序号从0开始。即每年序号需要重置为0.
  • 序号位:8位数值,不足8位前补0
  • 例如:BIZ-2024-00000231
cosid:
  segment:
    enabled: true
    distributor:
      type: redis
    provider:
      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

YearMonthGroupBySupplier

使用 SegmentId 算法,要求输出的ID字符串:

  • 起始序号:0
  • 格式:<prefix><year_month><sequence>
  • 分组:按年月分组,序号从0开始。即跨月序号需要重置为0.
  • 序号位:8位数值,不足8位前补0
  • 例如:BIZ-240516-00000061
cosid:
  segment:
    enabled: true
    distributor:
      type: redis
    provider:
      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

YearMonthDayGroupBySupplier

使用 SegmentId 算法,要求输出的ID字符串:

  • 起始序号:0
  • 格式:<prefix><year_month_day><sequence>
  • 分组:按日期分组,序号从0开始。即明天序号需要重置为0.
  • 序号位:8位数值,不足8位前补0
  • 例如:BIZ-240516-00000001
cosid:
  segment:
    enabled: true
    distributor:
      type: redis
    provider:
      group_year_month_day_biz:
        group:
          by: year_month_day
          pattern: yyMMdd
        converter:
          type: to_string
          to-string:
            pad-start: true
            char-size: 8
          prefix: BIZ-
          group-prefix:
            enabled: true

Full Changelog: v2.6.9...v2.8.0