multi
This commit is contained in:
12
state_machines/multi_module_sample/api-module/build.gradle
Normal file
12
state_machines/multi_module_sample/api-module/build.gradle
Normal file
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web:3.2.0'
|
||||
implementation 'org.springframework.statemachine:spring-statemachine-core:3.2.0'
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package click.kamil.multi.api;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@RequestMapping("/orders")
|
||||
public interface OrderApi {
|
||||
|
||||
@PostMapping("/submit")
|
||||
void submitOrder(@RequestBody String orderId);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package click.kamil.multi.api;
|
||||
|
||||
import org.springframework.statemachine.StateContext;
|
||||
import org.springframework.statemachine.action.Action;
|
||||
|
||||
public interface ProcessAction extends Action<String, String> {
|
||||
|
||||
@Override
|
||||
default void execute(StateContext<String, String> context) {
|
||||
System.out.println("Processing order: " + context.getMessageHeader("orderId"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user