Skip to content

Commit 8719350

Browse files
committed
test jap worker id complete
1 parent 2734470 commit 8719350

File tree

48 files changed

+133
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+133
-239
lines changed

.idea/encodings.xml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343

4444
<modules>
4545
<module>uid-generator</module>
46-
<module>uid-worker-mybatis-jdbc-spring-boot-starter</module>
46+
<module>uid-generator-mybatis-jdbc-spring-boot-starter</module>
4747
<module>uid-generator-api</module>
4848
<module>uid-generator-spring-boot-starter</module>
49-
<module>uid-worker-mybatis-r2dbc-spring-boot-starter</module>
50-
<module>uid-worker-jpa-r2dbc-spring-boot-starter</module>
51-
<module>uid-worker-jap-jdbc-spring-boot-starter</module>
49+
<module>uid-generator-mybatis-r2dbc-spring-boot-starter</module>
50+
<module>uid-generator-jpa-r2dbc-spring-boot-starter</module>
51+
<module>uid-generator-jap-jdbc-spring-boot-starter</module>
5252
</modules>
5353

5454
<properties>

uid-generator-api/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,5 @@
2929
<artifactId>reactor-core</artifactId>
3030
</dependency>
3131

32-
<dependency>
33-
<groupId>io.projectreactor</groupId>
34-
<artifactId>reactor-test</artifactId>
35-
<scope>test</scope>
36-
</dependency>
37-
3832
</dependencies>
3933
</project>

uid-worker-jap-jdbc-spring-boot-starter/pom.xml renamed to uid-generator-jap-jdbc-spring-boot-starter/pom.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<version>1.0.5-SNAPSHOT</version>
1010
</parent>
1111

12-
<artifactId>uid-worker-jap-jdbc-spring-boot-starter</artifactId>
12+
<artifactId>uid-generator-jap-jdbc-spring-boot-starter</artifactId>
1313

1414
<properties>
1515
<maven.compiler.source>15</maven.compiler.source>
@@ -20,7 +20,7 @@
2020
<dependencies>
2121
<dependency>
2222
<groupId>io.github.cooperlyt</groupId>
23-
<artifactId>uid-worker-id-db-provider</artifactId>
23+
<artifactId>uid-generator-spring-boot-starter</artifactId>
2424
<version>1.0.5-SNAPSHOT</version>
2525
</dependency>
2626

@@ -40,7 +40,11 @@
4040
<scope>test</scope>
4141
</dependency>
4242

43-
43+
<dependency>
44+
<groupId>io.projectreactor</groupId>
45+
<artifactId>reactor-test</artifactId>
46+
<scope>test</scope>
47+
</dependency>
4448

4549
</dependencies>
4650

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.springframework.transaction.annotation.Transactional;
77
import reactor.core.publisher.Mono;
88

9+
import java.util.Date;
910
import java.util.concurrent.CompletableFuture;
1011

1112

@@ -28,6 +29,9 @@ protected Mono<Long> assignWorkerId(WorkerNodeType type, String host, String por
2829
.type(type.value())
2930
.hostName(host)
3031
.port(port)
32+
.launchDate(new Date())
33+
.created(new Date())
34+
.modified(new Date())
3135
.build()
3236
).getId())));
3337
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import java.util.Map;
1515
//extends HibernateJpaConfiguration
1616
@Configuration
17-
@EnableJpaRepositories
17+
@EnableJpaRepositories("io.github.cooperlyt.cloud.uid.worker.jpa.jdbc.repositories")
1818
@EntityScan("io.github.cooperlyt.cloud.uid.worker.jpa.jdbc.entities")
19-
public class WorkerIdAutoConfigure extends HibernateJpaAutoConfiguration {
19+
public class WorkerIdAutoConfigure {
2020

2121

2222
private final WorkerNodeRepository workerNodeRepository;
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
import lombok.Data;
2121
import lombok.NoArgsConstructor;
2222

23+
import javax.persistence.*;
2324
import java.util.Date;
2425

2526
/**
2627
* Entity for M_WORKER_NODE
2728
*
2829
* @author yutianbao
2930
*/
31+
@Table(name = "WORKER_NODE")
32+
@Entity
3033
@Data
3134
@Builder
3235
@NoArgsConstructor
@@ -36,6 +39,8 @@ public class WorkerNodeEntity {
3639
/**
3740
* Entity unique id (table unique)
3841
*/
42+
@Id
43+
@GeneratedValue(strategy = GenerationType.IDENTITY)
3944
private long id;
4045

4146
/**
@@ -67,5 +72,4 @@ public class WorkerNodeEntity {
6772
* Last modified
6873
*/
6974
private Date modified;
70-
7175
}

0 commit comments

Comments
 (0)