Skip to content

Commit b2846ca

Browse files
authored
Merge pull request #77 from codingapi/dev
Dev
2 parents 1243e29 + eae1705 commit b2846ca

File tree

48 files changed

+573
-149
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

+573
-149
lines changed

example/example-application/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.codingapi.example.command;
2+
3+
import com.codingapi.example.event.TestEvent;
4+
import com.codingapi.example.infra.entity.TestEntity;
5+
import com.codingapi.example.infra.jpa.TestEntityRepository;
6+
import com.codingapi.springboot.framework.event.EventPusher;
7+
import lombok.AllArgsConstructor;
8+
import org.springframework.transaction.annotation.Transactional;
9+
import org.springframework.web.bind.annotation.GetMapping;
10+
import org.springframework.web.bind.annotation.RequestMapping;
11+
import org.springframework.web.bind.annotation.RestController;
12+
13+
@RestController
14+
@RequestMapping("/open/test")
15+
@AllArgsConstructor
16+
public class TestController {
17+
18+
private final TestEntityRepository testEntityRepository;
19+
20+
21+
@GetMapping("/hi")
22+
@Transactional
23+
public void hi(){
24+
TestEntity testEntity = new TestEntity("test");
25+
testEntityRepository.save(testEntity);
26+
27+
TestEvent event = new TestEvent(testEntity.getName());
28+
EventPusher.push(event);
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.codingapi.example.event;
2+
3+
import com.codingapi.springboot.framework.event.IEvent;
4+
5+
public class AEvent implements IEvent {
6+
7+
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.codingapi.example.event;
2+
3+
import com.codingapi.springboot.framework.event.IEvent;
4+
5+
public class BEvent implements IEvent {
6+
7+
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.codingapi.example.event;
2+
3+
import com.codingapi.springboot.framework.event.IEvent;
4+
5+
public class CEvent implements IEvent {
6+
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.codingapi.example.event;
2+
3+
import com.codingapi.springboot.framework.event.IAsyncEvent;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Getter;
6+
7+
@Getter
8+
@AllArgsConstructor
9+
public class TestEvent implements IAsyncEvent {
10+
11+
private String name;
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.codingapi.example.handler;
2+
3+
import com.codingapi.example.event.AEvent;
4+
import com.codingapi.example.event.BEvent;
5+
import com.codingapi.springboot.framework.event.EventPusher;
6+
import com.codingapi.springboot.framework.event.EventTraceContext;
7+
import com.codingapi.springboot.framework.event.IHandler;
8+
import lombok.extern.slf4j.Slf4j;
9+
import org.springframework.stereotype.Service;
10+
11+
@Slf4j
12+
@Service
13+
public class AHandler implements IHandler<AEvent> {
14+
15+
@Override
16+
public void handler(AEvent event) {
17+
log.info("a event:{},eventKey:{}",event, EventTraceContext.getInstance().getEventKey());
18+
19+
EventPusher.push(new BEvent());
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.codingapi.example.handler;
2+
3+
import com.codingapi.example.event.BEvent;
4+
import com.codingapi.example.event.CEvent;
5+
import com.codingapi.springboot.framework.event.EventPusher;
6+
import com.codingapi.springboot.framework.event.EventTraceContext;
7+
import com.codingapi.springboot.framework.event.IHandler;
8+
import lombok.extern.slf4j.Slf4j;
9+
import org.springframework.stereotype.Service;
10+
11+
@Slf4j
12+
@Service
13+
public class BHandler implements IHandler<BEvent> {
14+
15+
@Override
16+
public void handler(BEvent event) {
17+
log.info("b event:{},eventKey:{}",event, EventTraceContext.getInstance().getEventKey());
18+
19+
EventPusher.push(new CEvent());
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.codingapi.example.handler;
2+
3+
import com.codingapi.example.event.CEvent;
4+
import com.codingapi.springboot.framework.event.EventTraceContext;
5+
import com.codingapi.springboot.framework.event.IHandler;
6+
import lombok.extern.slf4j.Slf4j;
7+
import org.springframework.stereotype.Service;
8+
9+
@Slf4j
10+
@Service
11+
public class CHandler implements IHandler<CEvent> {
12+
13+
@Override
14+
public void handler(CEvent event) {
15+
log.info("c event:{},eventKey:{}", event, EventTraceContext.getInstance().getEventKey());
16+
17+
// EventPusher.push(new AEvent());
18+
throw new RuntimeException("c handler error");
19+
}
20+
21+
@Override
22+
public void error(Exception exception) throws Exception {
23+
log.error("c handler error:{}", exception.getMessage());
24+
throw exception;
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.codingapi.example.handler;
2+
3+
import com.codingapi.example.event.AEvent;
4+
import com.codingapi.example.event.TestEvent;
5+
import com.codingapi.example.infra.entity.TestEntity;
6+
import com.codingapi.example.infra.jpa.TestEntityRepository;
7+
import com.codingapi.springboot.framework.event.EventPusher;
8+
import com.codingapi.springboot.framework.event.IHandler;
9+
import lombok.AllArgsConstructor;
10+
import org.springframework.stereotype.Repository;
11+
12+
@Repository
13+
@AllArgsConstructor
14+
public class TestHandler implements IHandler<TestEvent> {
15+
16+
private TestEntityRepository testEntityRepository;
17+
18+
@Override
19+
public void handler(TestEvent event) {
20+
TestEntity entity = new TestEntity(event.getName()+"123");
21+
testEntityRepository.save(entity);
22+
23+
new Thread(()->{
24+
EventPusher.push(new AEvent());
25+
}).start();
26+
27+
new Thread(()->{
28+
EventPusher.push(new AEvent());
29+
}).start();
30+
}
31+
32+
33+
}

example/example-domain/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-jpa/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.codingapi.example.infra.entity;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.persistence.GeneratedValue;
5+
import jakarta.persistence.GenerationType;
6+
import jakarta.persistence.Id;
7+
import lombok.Getter;
8+
import lombok.NoArgsConstructor;
9+
import lombok.Setter;
10+
11+
@Setter
12+
@Getter
13+
@Entity
14+
@NoArgsConstructor
15+
public class TestEntity {
16+
17+
@Id
18+
@GeneratedValue(strategy = GenerationType.IDENTITY)
19+
private long id;
20+
21+
private String name;
22+
23+
public TestEntity(String name) {
24+
this.name = name;
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.codingapi.example.infra.jpa;
2+
3+
import com.codingapi.example.infra.entity.TestEntity;
4+
import com.codingapi.springboot.fast.jpa.repository.FastRepository;
5+
6+
public interface TestEntityRepository extends FastRepository<TestEntity,Long> {
7+
8+
}

example/example-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<parent>
1414
<groupId>com.codingapi.springboot</groupId>
1515
<artifactId>springboot-parent</artifactId>
16-
<version>3.3.3</version>
16+
<version>3.3.5</version>
1717
</parent>
1818

1919
<artifactId>springboot-example</artifactId>
20-
<version>3.3.3</version>
20+
<version>3.3.5</version>
2121

2222
<name>springboot-example</name>
2323
<description>springboot-example project for Spring Boot</description>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.codingapi.springboot</groupId>
1414
<artifactId>springboot-parent</artifactId>
15-
<version>3.3.3</version>
15+
<version>3.3.5</version>
1616

1717
<url>https://github.com/codingapi/springboot-framewrok</url>
1818
<name>springboot-parent</name>

springboot-starter-data-fast/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>3.3.3</version>
9+
<version>3.3.5</version>
1010
</parent>
1111

1212
<name>springboot-starter-flow</name>

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/build/FlowWorkBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import com.codingapi.springboot.flow.matcher.OperatorMatcher;
1111
import com.codingapi.springboot.flow.trigger.OutTrigger;
1212
import com.codingapi.springboot.flow.user.IFlowOperator;
13-
import com.codingapi.springboot.flow.utils.RandomGenerator;
13+
import com.codingapi.springboot.framework.utils.RandomGenerator;
1414

1515
/**
1616
* 流程工作构建器

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/domain/FlowWork.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.codingapi.springboot.flow.build.SchemaReader;
44
import com.codingapi.springboot.flow.serializable.FlowWorkSerializable;
55
import com.codingapi.springboot.flow.user.IFlowOperator;
6-
import com.codingapi.springboot.flow.utils.RandomGenerator;
6+
import com.codingapi.springboot.framework.utils.RandomGenerator;
77
import lombok.AllArgsConstructor;
88
import lombok.Getter;
99
import lombok.Setter;

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/record/FlowProcess.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.codingapi.springboot.flow.record;
22

33
import com.codingapi.springboot.flow.user.IFlowOperator;
4-
import com.codingapi.springboot.flow.utils.RandomGenerator;
4+
import com.codingapi.springboot.framework.utils.RandomGenerator;
55
import lombok.AllArgsConstructor;
66
import lombok.Getter;
77

springboot-starter-security/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>3.3.3</version>
9+
<version>3.3.5</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security</artifactId>

springboot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.codingapi.springboot</groupId>
77
<artifactId>springboot-parent</artifactId>
8-
<version>3.3.3</version>
8+
<version>3.3.5</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

0 commit comments

Comments
 (0)