Skip to content

Commit

Permalink
feat(doc): Update getting-started.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Aug 15, 2024
1 parent 1a55c3c commit ba3f09c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions documentation/docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 之旅。

0 comments on commit ba3f09c

Please sign in to comment.