Skip to content

Commit 69b94de

Browse files
committed
添加 solon-flow FlowContext.toJson(data) 方法
1 parent f09fea3 commit 69b94de

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

UPDATE_LOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* 优化 solon-flow (有包含结构的)网关的流入流出架构,使不再需要记录栈和计数器???
44

55

6+
### 3.10.5
7+
8+
* 添加 `solon-flow` FlowContext.toJson(data) 方法
9+
610
### 3.10.2
711

812
* 添加 `solon-flow` PlantumlOptions and displayMappingFunc for toPlantuml

solon-flow/src/main/java/org/noear/solon/flow/FlowContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ static FlowContext fromJson(String json) {
6464
*/
6565
String toJson();
6666

67+
/**
68+
* 将数据转为 json
69+
*/
70+
String toJson(Object data);
71+
6772
/// ////////////
6873

6974
/**

solon-flow/src/main/java/org/noear/solon/flow/FlowContextDefault.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public String toJson() {
104104
return oNode.toJson();
105105
}
106106

107+
@Override
108+
public String toJson(Object data) {
109+
return ONode.ofBean(data, OPTIONS).toJson();
110+
}
107111

108112
@Override
109113
public void exchanger(FlowExchanger exchanger) {

0 commit comments

Comments
 (0)