From ba3f09c42dfbc1455945adc6c08abea811b91e2b Mon Sep 17 00:00:00 2001 From: Ahoo Wang Date: Thu, 15 Aug 2024 09:30:04 +0800 Subject: [PATCH] feat(doc): Update getting-started.md --- documentation/docs/guide/getting-started.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/documentation/docs/guide/getting-started.md b/documentation/docs/guide/getting-started.md index fff2a52aa4..775a4db367 100644 --- a/documentation/docs/guide/getting-started.md +++ b/documentation/docs/guide/getting-started.md @@ -121,18 +121,16 @@ cosid: @Resource IdGeneratorProvider provider; @Resource - StringRedisTemplate stringRedisTemplate; - - public void createProvider(String idName) { - SpringRedisIdSegmentDistributor springRedisIdSegmentDistributor = new SpringRedisIdSegmentDistributor("namespace", "idName", stringRedisTemplate); - SegmentChainId segmentId = new SegmentChainId(springRedisIdSegmentDistributor); + IdSegmentDistributorFactory idSegmentDistributorFactory; + public void createIdGenerator(String idName) { + IdSegmentDistributorDefinition definition = new IdSegmentDistributorDefinition("namespace", "idName",0,100); + IdSegmentDistributor idSegmentDistributor = idSegmentDistributorFactory.create(definition); + SegmentChainId segmentId = new SegmentChainId(idSegmentDistributor); provider.set(idName, segmentId); } ``` - - ## Examples 开发者可以通过 [CosId-Examples](https://github.com/Ahoo-Wang/CosId/tree/main/examples) 的学习快速开启 `CosId` 之旅。