Skip to content

Commit 84de765

Browse files
committed
1.2.1 prepare
1 parent 1f264eb commit 84de765

File tree

25 files changed

+99
-289
lines changed

25 files changed

+99
-289
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.cn.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ UidReactiveGenerator是Java实现的, 基于[Snowflake](https://github.com/twitt
2323

2424
## 使用
2525

26+
|project-version|spring-boot|
27+
|:--|:--|
28+
|`1.1.x`|`<=2.7.x`|
29+
|`1.2.x`|`>=3`|
2630

2731
#### spring boot autoconfig 方式
2832

@@ -56,7 +60,7 @@ NOTE: 仅在Consul下测试,其它发现服务器没有进行测试。
5660
<version>2.3.0</version>
5761
</dependency>
5862
```
59-
* Mybatis R2DBC
63+
* Mybatis R2DBC (从1.2版本以后移除)
6064

6165
参见 [reactive-mybatis-support](https://github.com/chenggangpro/reactive-mybatis-support)
6266

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Refer [Snowflake](https://github.com/twitter/snowflake) and [UidGenerator](https
2424

2525
## Usage
2626

27+
28+
#### Description of applicable version
29+
30+
|project-version|spring-boot|
31+
|:--|:--|
32+
|`1.1.x`|`<=2.7.x`|
33+
|`1.2.x`|`>=3`|
34+
2735
### For Spring boot autoconfig
2836

2937
#### Worker node ID by Spring Discover service(not need databases)
@@ -56,8 +64,11 @@ NOTE: only test on Consul
5664
<version>2.3.0</version>
5765
</dependency>
5866
```
59-
* Mybatis R2DBC
60-
Refer [reactive-mybatis-support](https://github.com/chenggangpro/reactive-mybatis-support)
67+
* Mybatis R2DBC (Remove from 1.2.x)
68+
69+
参见 [reactive-mybatis-support](https://github.com/chenggangpro/reactive-mybatis-support)
70+
71+
6172
* JPA JDBC:
6273
```xml
6374
<dependency>

example/pom.xml

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,18 @@
66
<parent>
77
<groupId>io.github.cooperlyt</groupId>
88
<artifactId>uid-reactive-generator-spring</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.2.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>example</artifactId>
1313

14-
<properties>
15-
<maven.compiler.source>15</maven.compiler.source>
16-
<maven.compiler.target>15</maven.compiler.target>
17-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
</properties>
1914

2015
<dependencyManagement>
2116
<dependencies>
2217
<dependency>
2318
<groupId>org.springframework.cloud</groupId>
2419
<artifactId>spring-cloud-dependencies</artifactId>
25-
<version>2021.0.5</version>
20+
<version>2022.0.1</version>
2621
<type>pom</type>
2722
<scope>import</scope>
2823
</dependency>
@@ -46,33 +41,33 @@
4641

4742

4843
<!-- test spring cloud -->
49-
<dependency>
50-
<groupId>org.springframework.cloud</groupId>
51-
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
52-
53-
<exclusions>
54-
<!-- ribbon 已经在新版本中被弃用, 被 Spring Cloud Loadbalancer 替换-->
55-
<exclusion>
56-
<groupId>org.springframework.cloud</groupId>
57-
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
58-
</exclusion>
59-
</exclusions>
60-
</dependency>
44+
<!-- <dependency>-->
45+
<!-- <groupId>org.springframework.cloud</groupId>-->
46+
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
47+
48+
<!-- <exclusions>-->
49+
<!-- &lt;!&ndash; ribbon 已经在新版本中被弃用, 被 Spring Cloud Loadbalancer 替换&ndash;&gt;-->
50+
<!-- <exclusion>-->
51+
<!-- <groupId>org.springframework.cloud</groupId>-->
52+
<!-- <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>-->
53+
<!-- </exclusion>-->
54+
<!-- </exclusions>-->
55+
<!-- </dependency>-->
6156

62-
<dependency>
63-
<groupId>org.springframework.cloud</groupId>
64-
<artifactId>spring-cloud-gateway-webflux</artifactId>
65-
</dependency>
57+
<!-- <dependency>-->
58+
<!-- <groupId>org.springframework.cloud</groupId>-->
59+
<!-- <artifactId>spring-cloud-gateway-webflux</artifactId>-->
60+
<!-- </dependency>-->
6661

67-
<dependency>
68-
<groupId>org.springframework.boot</groupId>
69-
<artifactId>spring-boot-starter-actuator</artifactId>
70-
</dependency>
62+
<!-- <dependency>-->
63+
<!-- <groupId>org.springframework.boot</groupId>-->
64+
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
65+
<!-- </dependency>-->
7166

72-
<dependency>
73-
<groupId>org.springframework.cloud</groupId>
74-
<artifactId>spring-cloud-starter-consul-config</artifactId>
75-
</dependency>
67+
<!-- <dependency>-->
68+
<!-- <groupId>org.springframework.cloud</groupId>-->
69+
<!-- <artifactId>spring-cloud-starter-consul-config</artifactId>-->
70+
<!-- </dependency>-->
7671

7772
<!-- discovery worker node id -->
7873

@@ -87,22 +82,22 @@
8782
<dependency>
8883
<groupId>io.github.cooperlyt</groupId>
8984
<artifactId>uid-reactive-generator-db-spring-boot-starter</artifactId>
90-
<version>1.1.1</version>
85+
<version>1.2.1-SNAPSHOT</version>
9186
</dependency>
9287

9388
<!-- jdbc -->
9489

95-
<dependency>
96-
<groupId>org.mariadb.jdbc</groupId>
97-
<artifactId>mariadb-java-client</artifactId>
98-
</dependency>
90+
<!-- <dependency>-->
91+
<!-- <groupId>org.mariadb.jdbc</groupId>-->
92+
<!-- <artifactId>mariadb-java-client</artifactId>-->
93+
<!-- </dependency>-->
9994

10095
<!-- jpa jdbc -->
10196

102-
<dependency>
103-
<groupId>org.springframework.boot</groupId>
104-
<artifactId>spring-boot-starter-data-jpa</artifactId>
105-
</dependency>
97+
<!-- <dependency>-->
98+
<!-- <groupId>org.springframework.boot</groupId>-->
99+
<!-- <artifactId>spring-boot-starter-data-jpa</artifactId>-->
100+
<!-- </dependency>-->
106101

107102
<!-- mybatis jdbc -->
108103

@@ -116,15 +111,16 @@
116111

117112
<!-- r2dbc -->
118113

119-
<!-- <dependency>-->
120-
<!-- <groupId>org.mariadb</groupId>-->
121-
<!-- <artifactId>r2dbc-mariadb</artifactId>-->
122-
<!-- </dependency>-->
114+
<dependency>
115+
<groupId>org.mariadb</groupId>
116+
<artifactId>r2dbc-mariadb</artifactId>
117+
<version>1.1.3</version>
118+
</dependency>
123119

124-
<!-- <dependency>-->
125-
<!-- <groupId>org.springframework.boot</groupId>-->
126-
<!-- <artifactId>spring-boot-starter-data-r2dbc</artifactId>-->
127-
<!-- </dependency>-->
120+
<dependency>
121+
<groupId>org.springframework.boot</groupId>
122+
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
123+
</dependency>
128124

129125

130126
<!-- mybatis r2dbc -->

example/src/main/resources/application.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ spring:
66
application:
77
name: uid-example
88
profiles:
9-
active: jdbc
9+
active: jpa-r2dbc
1010
sql:
1111
init:
1212
mode: never
13-
cloud:
14-
consul:
15-
host: localhost
16-
port: 8500
13+
1714

1815
#开启actuator管理api
1916
management:
@@ -59,44 +56,17 @@ spring:
5956
activate:
6057
on-profile: jdbc
6158

62-
import: optional:consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}
6359
datasource:
6460
url: "jdbc:mariadb://127.0.0.1:3306/corp?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&allowMultiQueries=true"
6561
username: "root"
6662
password: "5257mq"
6763

68-
---
69-
70-
spring:
71-
config:
72-
activate:
73-
on-profile: mybatis-r2dbc
74-
75-
import: optional:consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}
76-
r2dbc:
77-
mybatis:
78-
r2dbc-url: r2dbc:mariadb://127.0.0.1:3306/corp?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false
79-
username: root
80-
password: 5257mq
81-
pool:
82-
max-idle-time: PT3M
83-
validation-query: SELECT 1 FROM DUAL
84-
initial-size: 1
85-
max-size: 3
86-
acquire-retry: 3
87-
validation-depth: REMOTE
88-
max-create-connection-time: PT30S
89-
r2dbc:
90-
mybatis:
91-
map-underscore-to-camel-case: true
92-
9364
---
9465
spring:
9566
config:
9667
activate:
9768
on-profile: jpa-r2dbc
9869

99-
import: optional:consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}
10070
r2dbc:
10171
url: "r2dbc:mariadb://127.0.0.1:3306/corp?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&allowMultiQueries=true"
10272
username: root
@@ -105,17 +75,16 @@ spring:
10575
---
10676

10777
spring:
108-
10978
config:
11079
activate:
11180
on-profile: cloud
112-
113-
import: optional:consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}
11481
cloud:
11582
loadbalancer:
11683
ribbon:
11784
enabled: false
11885
consul:
86+
host: localhost
87+
port: 8500
11988
ribbon:
12089
enabled: false
12190
discovery:

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.cooperlyt</groupId>
88
<artifactId>uid-reactive-generator-spring</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.2.1-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<name>uid-reactive-generator-spring</name>
@@ -51,9 +51,9 @@
5151
</modules>
5252

5353
<properties>
54-
<maven.compiler.source>15</maven.compiler.source>
55-
<maven.compiler.target>15</maven.compiler.target>
56-
<java.version>15</java.version>
54+
<maven.compiler.source>17</maven.compiler.source>
55+
<maven.compiler.target>17</maven.compiler.target>
56+
<java.version>17</java.version>
5757
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5858
<slf4j-version>2.0.6</slf4j-version>
5959

@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>org.springframework.boot</groupId>
6767
<artifactId>spring-boot-dependencies</artifactId>
68-
<version>2.7.8</version>
68+
<version>3.0.3</version>
6969
<type>pom</type>
7070
<scope>import</scope>
7171
</dependency>

uid-reactive-generator-api/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
<parent>
77
<groupId>io.github.cooperlyt</groupId>
88
<artifactId>uid-reactive-generator-spring</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.2.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>uid-reactive-generator-api</artifactId>
1313

14-
<properties>
15-
<maven.compiler.source>15</maven.compiler.source>
16-
<maven.compiler.target>15</maven.compiler.target>
17-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
</properties>
1914

2015
<dependencies>
2116
<dependency>

uid-reactive-generator-db-spring-boot-starter/pom.xml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,16 @@
66
<parent>
77
<groupId>io.github.cooperlyt</groupId>
88
<artifactId>uid-reactive-generator-spring</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.2.1-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>uid-reactive-generator-db-spring-boot-starter</artifactId>
1313

14-
<properties>
15-
<maven.compiler.source>15</maven.compiler.source>
16-
<maven.compiler.target>15</maven.compiler.target>
17-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
</properties>
19-
2014
<dependencies>
2115
<dependency>
2216
<groupId>io.github.cooperlyt</groupId>
2317
<artifactId>uid-reactive-generator-spring-boot-starter</artifactId>
24-
<version>1.1.1</version>
18+
<version>1.2.1-SNAPSHOT</version>
2519
</dependency>
2620

2721
<dependency>
@@ -39,14 +33,7 @@
3933
<dependency>
4034
<groupId>org.mybatis.spring.boot</groupId>
4135
<artifactId>mybatis-spring-boot-starter</artifactId>
42-
<version>2.3.0</version>
43-
<scope>provided</scope>
44-
</dependency>
45-
46-
<dependency>
47-
<groupId>pro.chenggang</groupId>
48-
<artifactId>mybatis-r2dbc-spring</artifactId>
49-
<version>1.2.5.RELEASE</version>
36+
<version>3.0.1</version>
5037
<scope>provided</scope>
5138
</dependency>
5239

uid-reactive-generator-db-spring-boot-starter/src/main/java/io/github/cooperlyt/cloud/uid/worker/WorkerNodeIdent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.github.cooperlyt.cloud.uid.worker;
22

3+
import jakarta.persistence.MappedSuperclass;
34
import lombok.AllArgsConstructor;
45
import lombok.Data;
56
import lombok.NoArgsConstructor;
67
import lombok.experimental.SuperBuilder;
78

8-
import javax.persistence.MappedSuperclass;
99

1010
@Data
1111
@SuperBuilder

0 commit comments

Comments
 (0)