Merge branch 'develop' into feature/core

This commit is contained in:
linwaiwai
2021-07-20 14:12:16 +08:00
committed by GitHub
26 changed files with 693 additions and 298 deletions

View File

@@ -190,6 +190,36 @@ var common = {
}
var result = ctx[stepName]['result'] || {};
return field ? result[field] : result;
},
/**
* 获取步骤循环结果
* @param {*} ctx 上下文 【必填】
* @param {*} stepName 步骤名【必填】
*/
getStepCircle: function (ctx, stepName){
if(!ctx || !stepName || !ctx[stepName]){
return null;
}
// 返回循环结果数组
return ctx[stepName]['circle'];
},
/**
* 获取请求的循环结果
* @param {*} ctx 上下文 【必填】
* @param {*} stepName 步骤名【必填】
*/
getRequestCircle: function (ctx, stepName, requestName){
if(!ctx || !stepName || !requestName){
return null;
}
if(!ctx[stepName] || !ctx[stepName]['requests'] || !ctx[stepName]['requests'][requestName] ||
!ctx[stepName]['requests'][requestName]['request']){
return null;
}
// 返回循环结果数组
return ctx[stepName]['requests'][requestName]['circle'];
}
/* *********** step request end ************ */

View File

@@ -46,7 +46,34 @@ var context = {
response: {
headers: {},
body: {}
}
},
// 请求循环组件当前循环对象
item: null,
// 请求循环组件当前循环对象的下标
index: null,
// 请求循环的结果
circle: [{
// 循环对象
item: null,
// 循环对象的下标
index: null,
// 请求相关参数
request:{
url: "",
method: "GET/POST",
headers: {},
body: {}
},
// 根据转换规则转换后的接口响应
response: {
headers: {},
body: {}
}
}],
// 条件组件的执行结果
conditionResults: [
{'我的条件1': true}
]
},
// 接口2
request2: {
@@ -59,13 +86,52 @@ var context = {
response: {
headers: {},
body: {}
}
},
// 请求循环组件当前循环对象
item: null,
// 请求循环组件当前循环对象的下标
index: null,
// 请求循环的结果
circle: [{
// 循环对象
item: null,
// 循环对象的下标
index: null,
// 请求相关参数
request:{
url: "",
method: "GET/POST",
headers: {},
body: {}
},
// 根据转换规则转换后的接口响应
response: {
headers: {},
body: {}
}
}],
// 条件组件的执行结果
conditionResults: [
{'我的条件1': true}
]
}
//...
},
// 步骤结果
result: {}
result: {},
// 步骤循环组件当前循环对象
item: null,
// 步骤循环组件当前循环对象的下标
index: null,
// 步骤循环的结果
circle:[{
// 循环对象
item: null,
// 循环对象的下标
index: null,
// 步骤结果
result: {}
}]
}
}

View File

@@ -12,7 +12,7 @@
<groupId>com.fizzgate</groupId>
<artifactId>fizz-bootstrap</artifactId>
<version>2.2.0-beta9</version>
<version>2.2.0-beta11</version>
<properties>
<java.version>1.8</java.version>

View File

@@ -190,6 +190,36 @@ var common = {
}
var result = ctx[stepName]['result'] || {};
return field ? result[field] : result;
},
/**
* 获取步骤循环结果
* @param {*} ctx 上下文 【必填】
* @param {*} stepName 步骤名【必填】
*/
getStepCircle: function (ctx, stepName){
if(!ctx || !stepName || !ctx[stepName]){
return null;
}
// 返回循环结果数组
return ctx[stepName]['circle'];
},
/**
* 获取请求的循环结果
* @param {*} ctx 上下文 【必填】
* @param {*} stepName 步骤名【必填】
*/
getRequestCircle: function (ctx, stepName, requestName){
if(!ctx || !stepName || !requestName){
return null;
}
if(!ctx[stepName] || !ctx[stepName]['requests'] || !ctx[stepName]['requests'][requestName] ||
!ctx[stepName]['requests'][requestName]['request']){
return null;
}
// 返回循环结果数组
return ctx[stepName]['requests'][requestName]['circle'];
}
/* *********** step request end ************ */