Skip to content

Commit

Permalink
feat(doc): update cosid-spring-data-jdbc.md (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang authored Jan 2, 2024
1 parent 01fd5c9 commit a6f7b80
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 24 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/benchmark-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,16 @@
name: Benchmark CosId Test
on:
push:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'examples/**'
- 'wiki/**'
paths:
- 'cosid-core/**'
- 'cosid-spring-redis/**'
- 'cosid-jdbc/**'
pull_request:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'examples/**'
- 'wiki/**'
paths:
- 'cosid-core/**'
- 'cosid-spring-redis/**'
- 'cosid-jdbc/**'
workflow_dispatch:

jobs:
cosid-core-benchmark:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/benchmark-vs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
push:
paths:
- 'cosid-benchmark/**'
workflow_dispatch:

jobs:
# WARNING:中央仓库没有找到美团官方提供的Jar!!!
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
pull_request:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
branches:
Expand All @@ -31,11 +32,12 @@ on:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
branches:
- 'main'

workflow_dispatch:
jobs:
docker-deploy:
name: Push Docker image
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/example-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@
name: Example Test
on:
push:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
paths:
- 'examples/**'
- 'wiki/**'
pull_request:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
paths:
- 'examples/**'
- 'wiki/**'
workflow_dispatch:

jobs:
example-redis-test:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ on:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
pull_request:
paths-ignore:
- 'cosid-benchmark/**'
- 'docs/**'
- 'document/**'
- 'documentation/**'
- 'examples/**'
- 'wiki/**'
env:
Expand Down
54 changes: 53 additions & 1 deletion documentation/docs/guide/extensions/cosid-spring-data-jdbc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CosId-Spring-Data-Jdbc 模块

[cosid-spring-data-jdbc](https://github.com/Ahoo-Wang/CosId/tree/main/cosid-spring-data-jdbc) 模块提供了对 `org.springframework.data.annotation.Id` 注解的支持,支持自动注入**分布式ID**

## 安装

::: code-group
Expand All @@ -16,4 +18,54 @@
</dependency>
</dependencies>
```
:::
:::

## 使用

::: code-group
```java [@Id]
static class IdEntity {
@Id
private long id;

public long getId() {
return id;
}

public IdEntity setId(int id) {
this.id = id;
return this;
}
}
```
```java [@CosId]
static class IdEntity {
@CosId
private long id;

public long getId() {
return id;
}

public IdEntity setId(int id) {
this.id = id;
return this;
}
}
```
```java [named 'id']
static class NamedIdEntity {

private long id;

public long getId() {
return id;
}

public NotFoundEntity setId(int id) {
this.id = id;
return this;
}
}
```
:::

0 comments on commit a6f7b80

Please sign in to comment.