Skip to content

Commit be36776

Browse files
committed
dev
1 parent 9e129d1 commit be36776

File tree

77 files changed

+700
-366
lines changed

Some content is hidden

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

77 files changed

+700
-366
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.codingapi.springboot</groupId>
8+
<artifactId>example-app</artifactId>
9+
<version>3.3.67</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>example-app-cmd-domain</artifactId>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.codingapi.springboot</groupId>
22+
<artifactId>example-domain-user</artifactId>
23+
<version>${project.version}</version>
24+
</dependency>
25+
26+
<dependency>
27+
<groupId>com.codingapi.springboot</groupId>
28+
<artifactId>example-domain-leave</artifactId>
29+
<version>${project.version}</version>
30+
</dependency>
31+
</dependencies>
32+
33+
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.codingapi.example.app.cmd.domain.pojo;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
public class UserCmd {
7+
8+
@Setter
9+
@Getter
10+
public static class UpdateRequest{
11+
private long id;
12+
private String name;
13+
private String username;
14+
private String password;
15+
private boolean flowManager;
16+
17+
public boolean hasId(){
18+
return id > 0;
19+
}
20+
}
21+
22+
23+
@Setter
24+
@Getter
25+
public static class EntrustRequest{
26+
private long id;
27+
private long entrustUserId;
28+
29+
}
30+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.codingapi.example.app.cmd.domain.router;
2+
3+
import com.codingapi.example.app.cmd.domain.pojo.UserCmd;
4+
import com.codingapi.example.domain.user.entity.User;
5+
import com.codingapi.example.domain.user.gateway.PasswordEncoder;
6+
import com.codingapi.example.domain.user.repository.UserRepository;
7+
import lombok.AllArgsConstructor;
8+
import org.springframework.stereotype.Component;
9+
10+
@Component
11+
@AllArgsConstructor
12+
public class UserRouter {
13+
14+
private final UserRepository userRepository;
15+
private final PasswordEncoder passwordEncoder;
16+
17+
public void save(UserCmd.UpdateRequest request){
18+
if(request.hasId()){
19+
User user = userRepository.getUserById(request.getId());
20+
user.setName(request.getName());
21+
user.setPassword(request.getPassword());
22+
user.setFlowManager(request.isFlowManager());
23+
user.encodePassword(passwordEncoder);
24+
userRepository.save(user);
25+
}else {
26+
User user = new User();
27+
user.setName(request.getName());
28+
user.setPassword(request.getPassword());
29+
user.setFlowManager(request.isFlowManager());
30+
user.encodePassword(passwordEncoder);
31+
userRepository.save(user);
32+
}
33+
}
34+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.codingapi.springboot</groupId>
8+
<artifactId>example-app</artifactId>
9+
<version>3.3.67</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>example-app-cmd-meta</artifactId>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.codingapi.springboot</groupId>
22+
<artifactId>example-infra-jpa</artifactId>
23+
<version>${project.version}</version>
24+
</dependency>
25+
26+
</dependencies>
27+
28+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.codingapi.springboot</groupId>
8+
<artifactId>example-app</artifactId>
9+
<version>3.3.67</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>example-app-query</artifactId>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
19+
20+
</project>

example/example-app/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.codingapi.springboot</groupId>
8+
<artifactId>springboot-example</artifactId>
9+
<version>3.3.67</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
<packaging>pom</packaging>
13+
<artifactId>example-app</artifactId>
14+
15+
<modules>
16+
<module>example-app-cmd-domain</module>
17+
<module>example-app-cmd-meta</module>
18+
<module>example-app-query</module>
19+
</modules>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
</properties>
24+
25+
26+
</project>

example/example-application/pom.xml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<artifactId>springboot-example</artifactId>
76
<groupId>com.codingapi.springboot</groupId>
7+
<artifactId>springboot-example</artifactId>
88
<version>3.3.67</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
@@ -19,29 +19,19 @@
1919
</properties>
2020

2121
<dependencies>
22-
<dependency>
23-
<groupId>com.codingapi.springboot</groupId>
24-
<artifactId>example-domain</artifactId>
25-
<version>${project.version}</version>
26-
</dependency>
2722

2823
<dependency>
2924
<groupId>com.codingapi.springboot</groupId>
30-
<artifactId>example-infra-jpa</artifactId>
25+
<artifactId>example-domain-leave</artifactId>
3126
<version>${project.version}</version>
3227
</dependency>
3328

3429
<dependency>
3530
<groupId>com.codingapi.springboot</groupId>
36-
<artifactId>example-infra-flow</artifactId>
31+
<artifactId>example-domain-user</artifactId>
3732
<version>${project.version}</version>
3833
</dependency>
3934

40-
<dependency>
41-
<groupId>com.mysql</groupId>
42-
<artifactId>mysql-connector-j</artifactId>
43-
</dependency>
44-
4535
<dependency>
4636
<groupId>com.codingapi.springboot</groupId>
4737
<artifactId>springboot-starter-security</artifactId>

example/example-application/src/main/java/com/codingapi/example/command/FlowRecordCmdController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.codingapi.example.command;
22

3-
import com.codingapi.example.domain.User;
3+
import com.codingapi.example.domain.user.entity.User;
4+
import com.codingapi.example.domain.user.repository.UserRepository;
45
import com.codingapi.example.pojo.cmd.FlowCmd;
5-
import com.codingapi.example.repository.UserRepository;
66
import com.codingapi.springboot.flow.pojo.FlowResult;
77
import com.codingapi.springboot.flow.pojo.FlowStepResult;
88
import com.codingapi.springboot.flow.pojo.FlowSubmitResult;

example/example-application/src/main/java/com/codingapi/example/command/TestController.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

example/example-application/src/main/java/com/codingapi/example/event/AEvent.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)