From 87c9b6de3be3efbbf5fae2dd87314f7688e83855 Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Tue, 22 Apr 2025 10:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E5=8F=91=E5=B8=83:=208.2.14?= =?UTF-8?q?=20=E5=89=8D=E7=AB=AF=E5=8F=91=E5=B8=83:=208.2.71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erm.frontend/package.json | 4 +- gradle.properties | 4 +- io.sc.engine.mv.frontend/package.json | 4 +- .../io/sc/engine/rule/core/WebRequest.java | 122 +++- .../generator/impl/processor/HttpRequest.java | 10 +- .../core/enums/HttpAuthorizationType.java | 3 +- .../HttpRequestIndicatorProcessor.java | 138 +++- .../HttpRequestParameterProcessor.java | 138 +++- .../engine/rule/core/util/WebRequestUtil.java | 5 +- .../core/code/template/dictionary_render.tpl | 4 +- .../sc/engine/rule/core/i18n/enums.properties | 5 +- .../rule/core/i18n/enums_tw_CN.properties | 5 +- .../rule/core/i18n/enums_zh_CN.properties | 5 +- io.sc.engine.rule.frontend/package.json | 4 +- .../src/i18n/messages.json | 31 + .../src/i18n/messages_tw_CN.json | 31 + .../src/i18n/messages_zh_CN.json | 31 + .../utils/JsonParameterAndValueTypeParser.ts | 102 +++ .../src/utils/VariableUtil.ts | 37 + .../resources/designer/HttpRequestDialog.vue | 663 ++++++++++++++++++ .../views/resources/designer/Processor.vue | 17 +- .../src/views/shared/AutoCompletionManager.ts | 9 + .../shared/processors/HttpRequest copy.ts | 580 +++++++++++++++ .../views/shared/processors/HttpRequest.ts | 411 +---------- .../dictionary/entity/DictionaryEntity.java | 5 +- .../UserDefinedJavaClassFieldEntity.java | 5 +- .../function/entity/FunctionEntity.java | 3 +- .../IndicatorProcessorEntityConverter.java | 26 +- .../rule/server/lib/entity/LibEntity.java | 5 +- .../HttpRequestIndicatorProcessorEntity.java | 300 ++++++-- .../HttpRequestIndicatorProcessorVo.java | 154 ++-- .../ParameterProcessorEntityConverter.java | 26 +- .../HttpRequestParameterProcessorEntity.java | 296 +++++--- .../HttpRequestParameterProcessorVo.java | 143 ++-- .../resource/entity/ResourceEntity.java | 5 +- ...20515__Rule Engine Database Schema DDL.xml | 40 +- io.sc.engine.st.frontend/package.json | 4 +- io.sc.platform.ai.frontend/package.json | 4 +- io.sc.platform.core.frontend/package.json | 2 +- .../src/platform/utils/Tools.ts | 9 + .../template-project/package.json | 4 +- .../java/io/sc/platform/core/Environment.java | 1 + .../io/sc/platform/core/util/PinyinUtil.java | 12 +- io.sc.platform.developer.doc/package.json | 4 +- .../package.json | 4 +- io.sc.platform.lcdp.frontend/package.json | 4 +- .../package.json | 4 +- io.sc.platform.mvc.frontend/package.json | 4 +- .../package.json | 4 +- io.sc.platform.system.frontend/package.json | 4 +- io.sc.standard.frontend/package.json | 4 +- io.sc.website/package.json | 4 +- 52 files changed, 2587 insertions(+), 856 deletions(-) create mode 100644 io.sc.engine.rule.frontend/src/utils/JsonParameterAndValueTypeParser.ts create mode 100644 io.sc.engine.rule.frontend/src/utils/VariableUtil.ts create mode 100644 io.sc.engine.rule.frontend/src/views/resources/designer/HttpRequestDialog.vue create mode 100644 io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest copy.ts diff --git a/erm.frontend/package.json b/erm.frontend/package.json index 505035ac..19d303c6 100644 --- a/erm.frontend/package.json +++ b/erm.frontend/package.json @@ -1,6 +1,6 @@ { "name": "erm.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/gradle.properties b/gradle.properties index e7241df6..012fe62a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -37,9 +37,9 @@ application_version=1.0.0 # platform ########################################################### platform_group=io.sc -platform_version=8.2.13 +platform_version=8.2.14 platform_plugin_version=8.2.10 -platform_core_frontend_version=8.2.70 +platform_core_frontend_version=8.2.71 ########################################################### # dependencies version diff --git a/io.sc.engine.mv.frontend/package.json b/io.sc.engine.mv.frontend/package.json index f1c24d15..01c47a8b 100644 --- a/io.sc.engine.mv.frontend/package.json +++ b/io.sc.engine.mv.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.mv.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/WebRequest.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/WebRequest.java index 2510b05e..97821080 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/WebRequest.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/WebRequest.java @@ -4,15 +4,23 @@ import io.sc.engine.rule.core.enums.HttpAuthorizationType; import io.sc.engine.rule.core.enums.HttpMethodType; public class WebRequest { - private HttpMethodType httpMethod; - private String httpUrl; - private HttpAuthorizationType httpAuthType; - private String httpAuthApikey; - private String httpAuthApiValue; - private String httpAuthBasicUsername; - private String httpAuthBasicPassword; - private String httpAuthBearerToken; - private String httpRequestBody; + private HttpMethodType httpMethod; // HTTP Method + private String httpUrl; // URL + private String httpUrlParameterValues; // URL 中参数的测试值 + private HttpAuthorizationType httpAuthType; // 认证类型 + private String httpAuthBasicUsername; // Basic 认证的用户名 + private String httpAuthBasicPassword; // Basic 认证的用户密码 + private String httpAuthBearerToken; // BearerToken + private String httpAuthParameterValues; // 认证中参数的测试值 + private String httpRequestHeader; // 请求头 + private String httpRequestHeaderParameterValues; // 请求头中参数的测试值 + private String httpRequestBody; // 请求 body + private String httpRequestBodyParameterValues; // 请求 body 中参数的测试值 + private int httpConnectTimeout; // 连接超时毫秒数 + private int httpRetryCountOnFailure; // 失败重试次数 + private boolean httpAsync; // 是否异步执行 + private boolean httpCache; // 是否缓存 + private String httpResponseMapping; // 响应 public HttpMethodType getHttpMethod() { return httpMethod; @@ -30,28 +38,20 @@ public class WebRequest { this.httpUrl = httpUrl; } - public HttpAuthorizationType getHttpAuthType() { - return httpAuthType; - } - - public void setHttpAuthType(HttpAuthorizationType httpAuthType) { - this.httpAuthType = httpAuthType; + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; } - public String getHttpAuthApikey() { - return httpAuthApikey; + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; } - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; - } - - public String getHttpAuthApiValue() { - return httpAuthApiValue; + public HttpAuthorizationType getHttpAuthType() { + return httpAuthType; } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { + this.httpAuthType = httpAuthType; } public String getHttpAuthBasicUsername() { @@ -78,6 +78,30 @@ public class WebRequest { this.httpAuthBearerToken = httpAuthBearerToken; } + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; + } + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; + } + + public String getHttpRequestHeader() { + return httpRequestHeader; + } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; + } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; + } + + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; + } + public String getHttpRequestBody() { return httpRequestBody; } @@ -85,4 +109,52 @@ public class WebRequest { public void setHttpRequestBody(String httpRequestBody) { this.httpRequestBody = httpRequestBody; } + + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + + public String getHttpResponseMapping() { + return httpResponseMapping; + } + + public void setHttpResponseMapping(String httpResponseMapping) { + this.httpResponseMapping = httpResponseMapping; + } } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/HttpRequest.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/HttpRequest.java index 1d16732f..9a19a82f 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/HttpRequest.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/generator/impl/processor/HttpRequest.java @@ -19,12 +19,9 @@ public class HttpRequest { sb.append("\trequest.setHttpUrl(").append(StringUtil.format("${0}", GroovyExpressionReplacer.groovy(processor.getHttpUrl(),String.class.getName()))).append(");\n"); if(processor.getHttpAuthType()!=null) { sb.append("\trequest.setHttpAuthType(").append("io.sc.engine.rule.core.enums.HttpAuthorizationType.").append(processor.getHttpAuthType()).append(");\n"); - if(HttpAuthorizationType.BASIC_AUTH.equals(processor.getHttpAuthType())){ + if(HttpAuthorizationType.BASIC.equals(processor.getHttpAuthType())){ sb.append("\trequest.setHttpAuthBasicUsername(").append(processor.getHttpAuthBasicUsername()).append(");\n"); sb.append("\trequest.setHttpAuthBasicPassword(").append(processor.getHttpAuthBasicPassword()).append(");\n"); - }else if(HttpAuthorizationType.API_KEY.equals(processor.getHttpAuthType())){ - sb.append("\trequest.setHttpAuthApikey(").append(processor.getHttpAuthApikey()).append(");\n"); - sb.append("\trequest.setHttpAuthApiValue(").append(processor.getHttpAuthApiValue()).append(");\n"); }else if(HttpAuthorizationType.BEARER.equals(processor.getHttpAuthType())){ sb.append("\trequest.setHttpAuthBearerToken(").append(StringUtil.format("${0}", GroovyExpressionReplacer.groovy(processor.getHttpAuthBearerToken(),String.class.getName()))).append(");\n"); } @@ -52,12 +49,9 @@ public class HttpRequest { sb.append("\trequest.setHttpUrl(").append(StringUtil.format("${0}", GroovyExpressionReplacer.groovy(processor.getHttpUrl(),String.class.getName()))).append(");\n"); if(processor.getHttpAuthType()!=null) { sb.append("\trequest.setHttpAuthType(").append("io.sc.engine.rule.core.enums.HttpAuthorizationType.").append(processor.getHttpAuthType()).append(");\n"); - if(HttpAuthorizationType.BASIC_AUTH.equals(processor.getHttpAuthType())){ + if(HttpAuthorizationType.BASIC.equals(processor.getHttpAuthType())){ sb.append("\trequest.setHttpAuthBasicUsername(").append(processor.getHttpAuthBasicUsername()).append(");\n"); sb.append("\trequest.setHttpAuthBasicPassword(").append(processor.getHttpAuthBasicPassword()).append(");\n"); - }else if(HttpAuthorizationType.API_KEY.equals(processor.getHttpAuthType())){ - sb.append("\trequest.setHttpAuthApikey(").append(processor.getHttpAuthApikey()).append(");\n"); - sb.append("\trequest.setHttpAuthApiValue(").append(processor.getHttpAuthApiValue()).append(");\n"); }else if(HttpAuthorizationType.BEARER.equals(processor.getHttpAuthType())){ sb.append("\trequest.setHttpAuthBearerToken(").append(StringUtil.format("${0}", GroovyExpressionReplacer.groovy(processor.getHttpAuthBearerToken(),String.class.getName()))).append(");\n"); } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpAuthorizationType.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpAuthorizationType.java index e637579f..1e81eaaa 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpAuthorizationType.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpAuthorizationType.java @@ -2,7 +2,6 @@ package io.sc.engine.rule.core.enums; public enum HttpAuthorizationType { NONE, - API_KEY, - BASIC_AUTH, + BASIC, BEARER } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java index c0a01e1b..09cf1352 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java @@ -16,93 +16,161 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("HTTP_REQUEST") @JsonIgnoreProperties(ignoreUnknown=true) public class HttpRequestIndicatorProcessor extends IndicatorProcessor { - private HttpMethodType httpMethod; - private String httpUrl; - private HttpAuthorizationType httpAuthType; - private String httpAuthApikey; - private String httpAuthApiValue; - private String httpAuthApiAddTo; - private String httpAuthBasicUsername; - private String httpAuthBasicPassword; - private String httpAuthBearerToken; - private String httpParams; - private String httpRequestBody; - private String httpResponseMapping; + private HttpMethodType httpMethod; // HTTP Method + private String httpUrl; // URL + private String httpUrlParameterValues; // URL 中参数的测试值 + private HttpAuthorizationType httpAuthType; // 认证类型 + private String httpAuthBasicUsername; // Basic 认证的用户名 + private String httpAuthBasicPassword; // Basic 认证的用户密码 + private String httpAuthBearerToken; // BearerToken + private String httpAuthParameterValues; // 认证中参数的测试值 + private String httpRequestHeader; // 请求头 + private String httpRequestHeaderParameterValues; // 请求头中参数的测试值 + private String httpRequestBody; // 请求 body + private String httpRequestBodyParameterValues; // 请求 body 中参数的测试值 + private int httpConnectTimeout; // 连接超时毫秒数 + private int httpRetryCountOnFailure; // 失败重试次数 + private boolean httpAsync; // 是否异步执行 + private boolean httpCache; // 是否缓存 + private String httpResponseMapping; // 响应 @Override public ProcessorType getType() { return ProcessorType.HTTP_REQUEST; } - + public HttpMethodType getHttpMethod() { return httpMethod; } + public void setHttpMethod(HttpMethodType httpMethod) { this.httpMethod = httpMethod; } + public String getHttpUrl() { return httpUrl; } + public void setHttpUrl(String httpUrl) { this.httpUrl = httpUrl; } + + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; + } + + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; + } + public HttpAuthorizationType getHttpAuthType() { return httpAuthType; } + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { this.httpAuthType = httpAuthType; } - public String getHttpAuthApikey() { - return httpAuthApikey; - } - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; - } - public String getHttpAuthApiValue() { - return httpAuthApiValue; - } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; - } - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; - } - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; - } + public String getHttpAuthBasicUsername() { return httpAuthBasicUsername; } + public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { this.httpAuthBasicUsername = httpAuthBasicUsername; } + public String getHttpAuthBasicPassword() { return httpAuthBasicPassword; } + public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { this.httpAuthBasicPassword = httpAuthBasicPassword; } + public String getHttpAuthBearerToken() { return httpAuthBearerToken; } + public void setHttpAuthBearerToken(String httpAuthBearerToken) { this.httpAuthBearerToken = httpAuthBearerToken; } - public String getHttpParams() { - return httpParams; + + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; + } + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + + public String getHttpRequestHeader() { + return httpRequestHeader; + } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; + } + + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; + } + public String getHttpRequestBody() { return httpRequestBody; } + public void setHttpRequestBody(String httpRequestBody) { this.httpRequestBody = httpRequestBody; } + + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + public String getHttpResponseMapping() { return httpResponseMapping; } + public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java index 9d736da6..98aedd1f 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java @@ -16,93 +16,161 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("HTTP_REQUEST") @JsonIgnoreProperties(ignoreUnknown=true) public class HttpRequestParameterProcessor extends ParameterProcessor { - private HttpMethodType httpMethod; - private String httpUrl; - private HttpAuthorizationType httpAuthType; - private String httpAuthApikey; - private String httpAuthApiValue; - private String httpAuthApiAddTo; - private String httpAuthBasicUsername; - private String httpAuthBasicPassword; - private String httpAuthBearerToken; - private String httpParams; - private String httpRequestBody; - private String httpResponseMapping; + private HttpMethodType httpMethod; // HTTP Method + private String httpUrl; // URL + private String httpUrlParameterValues; // URL 中参数的测试值 + private HttpAuthorizationType httpAuthType; // 认证类型 + private String httpAuthBasicUsername; // Basic 认证的用户名 + private String httpAuthBasicPassword; // Basic 认证的用户密码 + private String httpAuthBearerToken; // BearerToken + private String httpAuthParameterValues; // 认证中参数的测试值 + private String httpRequestHeader; // 请求头 + private String httpRequestHeaderParameterValues; // 请求头中参数的测试值 + private String httpRequestBody; // 请求 body + private String httpRequestBodyParameterValues; // 请求 body 中参数的测试值 + private int httpConnectTimeout; // 连接超时毫秒数 + private int httpRetryCountOnFailure; // 失败重试次数 + private boolean httpAsync; // 是否异步执行 + private boolean httpCache; // 是否缓存 + private String httpResponseMapping; // 响应 @Override public ProcessorType getType() { return ProcessorType.HTTP_REQUEST; } - + public HttpMethodType getHttpMethod() { return httpMethod; } + public void setHttpMethod(HttpMethodType httpMethod) { this.httpMethod = httpMethod; } + public String getHttpUrl() { return httpUrl; } + public void setHttpUrl(String httpUrl) { this.httpUrl = httpUrl; } + + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; + } + + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; + } + public HttpAuthorizationType getHttpAuthType() { return httpAuthType; } + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { this.httpAuthType = httpAuthType; } - public String getHttpAuthApikey() { - return httpAuthApikey; - } - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; - } - public String getHttpAuthApiValue() { - return httpAuthApiValue; - } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; - } - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; - } - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; - } + public String getHttpAuthBasicUsername() { return httpAuthBasicUsername; } + public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { this.httpAuthBasicUsername = httpAuthBasicUsername; } + public String getHttpAuthBasicPassword() { return httpAuthBasicPassword; } + public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { this.httpAuthBasicPassword = httpAuthBasicPassword; } + public String getHttpAuthBearerToken() { return httpAuthBearerToken; } + public void setHttpAuthBearerToken(String httpAuthBearerToken) { this.httpAuthBearerToken = httpAuthBearerToken; } - public String getHttpParams() { - return httpParams; + + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; + } + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + + public String getHttpRequestHeader() { + return httpRequestHeader; + } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; + } + + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; + } + public String getHttpRequestBody() { return httpRequestBody; } + public void setHttpRequestBody(String httpRequestBody) { this.httpRequestBody = httpRequestBody; } + + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + public String getHttpResponseMapping() { return httpResponseMapping; } + public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/WebRequestUtil.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/WebRequestUtil.java index a372a4e6..d5969c92 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/WebRequestUtil.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/util/WebRequestUtil.java @@ -24,10 +24,7 @@ public class WebRequestUtil { switch (httpAuthType) { case NONE: break; - case API_KEY: - headerBuilder.add(webRequest.getHttpAuthApikey() + "=" + webRequest.getHttpAuthApiValue()); - break; - case BASIC_AUTH: + case BASIC: headerBuilder.add("Authorization:Basic " + Base64.getEncoder().encodeToString(webRequest.getHttpAuthBasicUsername().getBytes(StandardCharsets.UTF_8)) + Base64.getEncoder().encodeToString(webRequest.getHttpAuthBasicPassword().getBytes(StandardCharsets.UTF_8))); break; case BEARER: diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/dictionary_render.tpl b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/dictionary_render.tpl index bd3b307b..a05f3d0b 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/dictionary_render.tpl +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/dictionary_render.tpl @@ -4,10 +4,10 @@ */ @JsonIgnoreProperties(ignoreUnknown=true) class #(className(dictionary.code,dictionary.version)) { - #(tabs(DictionaryGenerator.generateFields(dictionary.getFields()),1)) + #(tabs(DictionaryGenerator.generateFields(dictionary),1)) public void init(){ - #(tabs(DictionaryGenerator.generateInits(dictionary.getFields()),2)) + #(tabs(DictionaryGenerator.generateFieldInits(dictionary),2)) } } #end \ No newline at end of file diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties index bf872b78..ed68a5d4 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties @@ -95,9 +95,8 @@ io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE #================================================ # HTTP \u8BA4\u8BC1\u65B9\u6CD5\u679A\u4E3E #================================================ -io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=No Auth -io.sc.engine.rule.core.enums.HttpAuthorizationType.API_KEY=API Key -io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC_AUTH=Basic Auth +io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=NONE +io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC=Basic io.sc.engine.rule.core.enums.HttpAuthorizationType.BEARER=Bearer Token #================================================ diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties index 1badb2df..93c6da75 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties @@ -95,9 +95,8 @@ io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE #================================================ # HTTP \u8BA4\u8BC1\u65B9\u6CD5\u679A\u4E3E #================================================ -io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=No Auth -io.sc.engine.rule.core.enums.HttpAuthorizationType.API_KEY=API Key -io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC_AUTH=Basic Auth +io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=NONE +io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC=Basic io.sc.engine.rule.core.enums.HttpAuthorizationType.BEARER=Bearer Token #================================================ diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties index 4b9d1357..e5a93850 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties @@ -96,9 +96,8 @@ io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE #================================================ # HTTP \u8BA4\u8BC1\u65B9\u6CD5\u679A\u4E3E #================================================ -io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=No Auth -io.sc.engine.rule.core.enums.HttpAuthorizationType.API_KEY=API Key -io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC_AUTH=Basic Auth +io.sc.engine.rule.core.enums.HttpAuthorizationType.NONE=NONE +io.sc.engine.rule.core.enums.HttpAuthorizationType.BASIC=Basic io.sc.engine.rule.core.enums.HttpAuthorizationType.BEARER=Bearer Token #================================================ diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 43d807f8..2e65ccc3 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/io.sc.engine.rule.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.rule.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages.json b/io.sc.engine.rule.frontend/src/i18n/messages.json index 223c182d..bc637ef8 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages.json @@ -108,6 +108,37 @@ "re.processor.dialog.decisionTree.title": "Decision Tree Designer", "re.processor.dialog.executionFlow.title": "Execution Flow Designer", + "re.processor.dialog.httpRequest.title": "HTTP Request", + + "re.processor.httpRequest.tab.url.title": "URL", + "re.processor.httpRequest.tab.authorization.title": "Authorization", + "re.processor.httpRequest.tab.header.title": "Header", + "re.processor.httpRequest.tab.body.title": "Body", + "re.processor.httpRequest.tab.advance.title": "Advance", + + "re.processor.httpRequest.entity.httpMethod": "HTTP Method", + "re.processor.httpRequest.entity.httpUrl": "URL", + "re.processor.httpRequest.entity.httpUrlParameterValues": "Parameters", + + "re.processor.httpRequest.entity.httpAuthType": "Authorization Mode", + "re.processor.httpRequest.entity.httpAuthBasicUsername": "User Name", + "re.processor.httpRequest.entity.httpAuthBasicPassword": "Password", + "re.processor.httpRequest.entity.httpAuthBearerToken": "Bearer Token", + "re.processor.httpRequest.entity.httpAuthParameterValues": "Parameters", + + "re.processor.httpRequest.entity.httpRequestHeader": "Request Header", + "re.processor.httpRequest.entity.httpRequestHeaderParameterValues": "Parameters", + + "re.processor.httpRequest.entity.httpRequestBody": "Request Body", + "re.processor.httpRequest.entity.httpRequestBodyParameterValues": "Parameters", + + "re.processor.httpRequest.entity.httpConnectTimeout": "Connect Timeout(unit: milliseconds, 1000 milliseconds equals 1 second)", + "re.processor.httpRequest.entity.httpRetryCountOnFailure": "Count of Retry on Failured", + "re.processor.httpRequest.entity.httpAsync": "Is Asynchronous?", + "re.processor.httpRequest.entity.httpCache": "Is Cache?", + + "re.processor.httpRequest.entity.httpResponseBody": "Response Body", + "re.processor.httpRequest.entity.httpResponseMapping": "Data Mapping", "re.processor.grid.title": "Processor", "re.processor.grid.entity.content": "Content", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json b/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json index 7460e3d7..71d00781 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json @@ -108,6 +108,37 @@ "re.processor.dialog.decisionTree.title": "決策樹設計器", "re.processor.dialog.executionFlow.title": "執行流設計器", + "re.processor.dialog.httpRequest.title": "HTTP 請求", + + "re.processor.httpRequest.tab.url.title": "URL", + "re.processor.httpRequest.tab.authorization.title": "認證", + "re.processor.httpRequest.tab.header.title": "請求頭", + "re.processor.httpRequest.tab.body.title": "請求體", + "re.processor.httpRequest.tab.advance.title": "高級", + + "re.processor.httpRequest.entity.httpMethod": "請求方法", + "re.processor.httpRequest.entity.httpUrl": "URL", + "re.processor.httpRequest.entity.httpUrlParameterValues": "參數值", + + "re.processor.httpRequest.entity.httpAuthType": "認證模式", + "re.processor.httpRequest.entity.httpAuthBasicUsername": "用戶名稱", + "re.processor.httpRequest.entity.httpAuthBasicPassword": "用戶登錄密碼", + "re.processor.httpRequest.entity.httpAuthBearerToken": "令牌", + "re.processor.httpRequest.entity.httpAuthParameterValues": "參數值", + + "re.processor.httpRequest.entity.httpRequestHeader": "請求頭", + "re.processor.httpRequest.entity.httpRequestHeaderParameterValues": "參數值", + + "re.processor.httpRequest.entity.httpRequestBody": "請求體", + "re.processor.httpRequest.entity.httpRequestBodyParameterValues": "參數值", + + "re.processor.httpRequest.entity.httpConnectTimeout": "連接超時上限(單位:毫秒, 1000 毫秒等於 1 秒)", + "re.processor.httpRequest.entity.httpRetryCountOnFailure": "失敗後重試次數", + "re.processor.httpRequest.entity.httpAsync": "是否異步請求?", + "re.processor.httpRequest.entity.httpCache": "是否啟用緩存?", + + "re.processor.httpRequest.entity.httpResponseBody": "響應體", + "re.processor.httpRequest.entity.httpResponseMapping": "數據映射", "re.processor.grid.title": "處理邏輯", "re.processor.grid.entity.content": "內容", diff --git a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json index a7d18466..50f29be8 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json @@ -109,6 +109,37 @@ "re.processor.dialog.decisionTree.title": "决策树设计器", "re.processor.dialog.executionFlow.title": "执行流设计器", + "re.processor.dialog.httpRequest.title": "HTTP 请求", + + "re.processor.httpRequest.tab.url.title": "URL", + "re.processor.httpRequest.tab.authorization.title": "认证", + "re.processor.httpRequest.tab.header.title": "请求头", + "re.processor.httpRequest.tab.body.title": "请求体", + "re.processor.httpRequest.tab.advance.title": "高级", + + "re.processor.httpRequest.entity.httpMethod": "请求方法", + "re.processor.httpRequest.entity.httpUrl": "URL", + "re.processor.httpRequest.entity.httpUrlParameterValues": "测试值", + + "re.processor.httpRequest.entity.httpAuthType": "认证模式", + "re.processor.httpRequest.entity.httpAuthBasicUsername": "用户名称", + "re.processor.httpRequest.entity.httpAuthBasicPassword": "用户登录密码", + "re.processor.httpRequest.entity.httpAuthBearerToken": "令牌", + "re.processor.httpRequest.entity.httpAuthParameterValues": "测试值", + + "re.processor.httpRequest.entity.httpRequestHeader": "请求头", + "re.processor.httpRequest.entity.httpRequestHeaderParameterValues": "测试值", + + "re.processor.httpRequest.entity.httpRequestBody": "请求体", + "re.processor.httpRequest.entity.httpRequestBodyParameterValues": "测试值", + + "re.processor.httpRequest.entity.httpConnectTimeout": "连接超时上限(单位:毫秒, 1000 毫秒等于 1 秒)", + "re.processor.httpRequest.entity.httpRetryCountOnFailure": "失败后重试次数", + "re.processor.httpRequest.entity.httpAsync": "是否异步请求?", + "re.processor.httpRequest.entity.httpCache": "是否启用缓存?", + + "re.processor.httpRequest.entity.httpResponseBody": "响应体", + "re.processor.httpRequest.entity.httpResponseMapping": "数据映射", "re.processor.grid.title": "处理逻辑", "re.processor.grid.entity.content": "内容", diff --git a/io.sc.engine.rule.frontend/src/utils/JsonParameterAndValueTypeParser.ts b/io.sc.engine.rule.frontend/src/utils/JsonParameterAndValueTypeParser.ts new file mode 100644 index 00000000..d0553489 --- /dev/null +++ b/io.sc.engine.rule.frontend/src/utils/JsonParameterAndValueTypeParser.ts @@ -0,0 +1,102 @@ +import { Tools } from 'platform-core'; + +class JsonParameterAndValueTypeParser { + public static isPrimary(obj: any) { + return Tools.isBoolean(obj) || Tools.isString(obj) || Tools.isNumber(obj); + } + + public static parseJsonString(str: string, code: string, name: string) { + if (Tools.isUndefinedOrNull(str)) { + return null; + } + const data = Tools.json2Object(str); + if (Tools.isUndefinedOrNull(data)) { + return null; + } + const parameterAndValueType = { + parameters: {}, + valueTypes: {}, + }; + JsonParameterAndValueTypeParser.parseObject(data, code, name, parameterAndValueType); + return parameterAndValueType; + } + + public static parseJsonObject(obj: any, code: string, name: string) { + if (Tools.isUndefinedOrNull(obj)) { + return null; + } + const parameterAndValueType = { + parameters: {}, + valueTypes: {}, + }; + JsonParameterAndValueTypeParser.parseObject(obj, code, name, parameterAndValueType); + return parameterAndValueType; + } + + private static parseObject(obj: any, code: string, name: string, parameterAndValueType: any) { + if (JsonParameterAndValueTypeParser.isPrimary(obj)) { + JsonParameterAndValueTypeParser.doParsePrimary(obj, code, name, parameterAndValueType); + } else if (Tools.isArray(obj)) { + JsonParameterAndValueTypeParser.doParseArray(obj, code, name, parameterAndValueType); + } else if (Tools.isObject(obj)) { + JsonParameterAndValueTypeParser.doParseObject(obj, code, name, parameterAndValueType); + } + } + + private static doParsePrimary(obj: any, code: string, name: string, parameterAndValueType: any) { + if (Tools.isUndefinedOrNull(obj)) { + return; + } + const parameter = { + code: code, + name: name, + type: 'OUT', + valueType: null, + valueTypeVersion: null, + valueTypeIsList: false, + }; + if (Tools.isBoolean(obj)) { + parameter.valueType = 'java.lang.Boolean'; + } else if (Tools.isString(obj)) { + parameter.valueType = 'java.lang.String'; + } else if (Tools.isNumber(obj)) { + parameter.valueType = 'java.math.BigDecimal'; + } + parameterAndValueType.parameters[code] = parameter; + parameterAndValueType.parameters[name] = parameter; + } + + private static doParseArray(array: any, code: string, name: string, parameterAndValueType: any) { + if (Tools.isUndefinedOrNull(array)) { + return; + } + const parameter = { + code: code, + name: name, + type: 'OUT', + valueType: null, + valueTypeVersion: null, + valueTypeIsList: true, + }; + + const firstElement = array[0]; + } + + private static doParseObject(array: any, code: string, name: string, parameterAndValueType: any) { + if (Tools.isUndefinedOrNull(array)) { + return; + } + const parameter = { + code: code, + name: name, + type: 'OUT', + valueType: null, + valueTypeVersion: null, + valueTypeIsList: true, + }; + + const firstElement = array[0]; + } +} + +export { JsonParameterAndValueTypeParser }; diff --git a/io.sc.engine.rule.frontend/src/utils/VariableUtil.ts b/io.sc.engine.rule.frontend/src/utils/VariableUtil.ts new file mode 100644 index 00000000..5333b06c --- /dev/null +++ b/io.sc.engine.rule.frontend/src/utils/VariableUtil.ts @@ -0,0 +1,37 @@ +import { Tools } from 'platform-core'; + +class VariableUtil { + private static Dollar_Reg = /(\$\{(.+?)\})(\[(.+?)\])?((\[(.+?)\])?(\.?(\$\{(.+?)\})(\[(.+?)\])?)+?)*/g; + private static Well_Reg = /#\{(.+?)\}\.#\{(.+?)\}/g; + + /** + * 抽取字符串中的占位符,占位符格式如下: + * ${aaa} + * ${bbb}[1] + * ${ccc}[1].${ddd} + * ${eee}[1].${fff}[2] + * ${ggg}[1].${hhh}[2].${iii} + * #{aaa}.#{bbb} + * @param str 字符串 + * @returns 占位符数组 + */ + public static extract(str: string): string[] { + if (Tools.isUndefinedOrNull(str)) { + return []; + } + + const dollarMatches: any = str.match(VariableUtil.Dollar_Reg) || []; + const wellMatches: any = str.match(VariableUtil.Well_Reg) || []; + + const result: any[] = []; + dollarMatches.forEach((item: any) => { + result.push(item); + }); + wellMatches.forEach((item: any) => { + result.push(item); + }); + return result; + } +} + +export { VariableUtil }; diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/HttpRequestDialog.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/HttpRequestDialog.vue new file mode 100644 index 00000000..19ba9583 --- /dev/null +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/HttpRequestDialog.vue @@ -0,0 +1,663 @@ + + diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue index 2308ce89..e789193d 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue @@ -42,6 +42,14 @@ decisionTreeDialogRef.open(parameter.id, args.selected?.id); } else if ('EXECUTION_FLOW' === type) { executionFlowDialogRef.open(parameter.id, args.selected?.id); + } else if ('HTTP_REQUEST' === type) { + const context = { + targetType: 'parameter', + target: parameter, + processor: args.selected, + processorGrid: gridRef, + }; + httpRequestDialogRef.open(context); } else { args._click(args); } @@ -91,7 +99,7 @@ name: 'type', label: $t('type'), sortable: false, - format: (value, row) => { + format: (value: any, row: any) => { return $t('io.sc.engine.rule.core.enums.ProcessorType.' + value); }, }, @@ -139,18 +147,19 @@ }, }" @before-editor-data-submit=" - (args) => { + (args: any) => { processorManager.beforeEditorDataSubmit(args); } " @after-editor-open=" - (args) => { + (args: any) => { processorManager.afterEditorOpen(args); } " > + []); + #HttpAuthorizationTypeEnum: any; + #httpAuthorizationTypeOptionsRef = ref([]); + + constructor(targetType: string, context?: any) { + super(targetType, context); + this.PROCESSOR_TYPE = 'HTTP_REQUEST'; + this.EDITOR_DIALOG_WIDTH = 1100; + } + + public getToolbarAction(): any { + return { + extend: 'add', + name: 'http', + label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE), + icon: 'sync_alt', + enableIf: (args: any) => { + const valueType = this.context.target.valueType; + return valueType !== 'io.sc.engine.rule.core.SingleRuleResult' && valueType !== 'io.sc.engine.rule.core.RuleSetResult'; + }, + afterClick: (args: any) => { + args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE); + }, + }; + } + + public format(row: any): any { + return row.httpMethod + ', ' + PlaceHolder.replace(row.httpUrl); + } + + public getEditorFields(): any { + return [ + { + colSpan: 2, + name: 'httpMethod', + label: $t('re.processor.grid.entity.httpMethod'), + type: 'w-select', + options: this.#httpMethodTypeOptionsRef, + rows: 1, + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + }, + { + colSpan: 2, + name: 'httpAuthType', + label: $t('re.processor.grid.entity.httpAuthType'), + type: 'w-select', + options: this.#httpAuthorizationTypeOptionsRef, + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + }, + { + colSpan: 4, + name: 'httpAuthApikey', + label: $t('re.processor.grid.entity.httpAuthApikey'), + type: 'w-text', + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; + }, + }, + { + colSpan: 4, + name: 'httpAuthApiValue', + label: $t('re.processor.grid.entity.httpAuthApiValue'), + type: 'w-text', + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; + }, + }, + { + colSpan: 4, + name: 'httpAuthBasicUsername', + label: $t('re.processor.grid.entity.httpAuthBasicUsername'), + type: 'w-text', + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; + }, + }, + { + colSpan: 4, + name: 'httpAuthBasicPassword', + label: $t('re.processor.grid.entity.httpAuthBasicPassword'), + type: 'w-text', + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; + }, + }, + { + colSpan: 8, + name: 'httpAuthBearerToken', + label: $t('re.processor.grid.entity.httpAuthBearerToken'), + type: 'w-text', + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BEARER'; + }, + }, + { + colSpan: 6, + firstCol: true, + name: 'httpUrl', + label: $t('re.processor.grid.entity.httpUrl'), + type: 'w-code-mirror', + lang: 'javascript', + rows: 6, + toolbar: false, + placeholder: true, + lineWrap: true, + lineBreak: true, + lineHeight: '1.3rem', + fontSize: '0.75rem', + autoCompletion: this.autoCompletionManager.autoCompletion(), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + }, + { + colSpan: 6, + name: 'httpUrlParameterValues', + label: $t('re.processor.grid.entity.httpUrlParameterValues'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-grid', + height: 93, + title: $t('re.processor.grid.entity.httpUrlParameterValues'), + localMode: true, + autoFetchData: false, + dense: true, + dbClickOperation: 'edit', + dndMode: 'local', + pageable: false, + configButton: false, + toolbarConfigure: { noIcon: false }, + toolbarActions: [ + { + name: 'analyze', + label: $t('analyze'), + icon: 'bi-tag', + click: (args: any) => { + const sql = this.#editorForm.getFieldValue('httpUrl'); + const regex = /\$\{[\u0000-\uFFFF]+?\}/g; + const array: any[] = sql.match(regex); + const rows: any[] = []; + array.forEach((item) => { + rows.push({ name: item, value: '' }); + }); + const grid = this.#editorForm.getFieldComponent('httpUrlParameterValues'); + grid.setLocalData(rows); + }, + }, + 'separator', + 'add', + 'edit', + [ + { + extend: 'remove', + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpUrlParameterValues'); + grid.removeRows(args.selecteds); + }, + }, + { + extend: 'remove', + name: 'removeAll', + label: $t('deleteAll'), + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpUrlParameterValues'); + grid.setLocalData([]); + }, + }, + ], + ], + columns: [ + { + width: '50%', + name: 'name', + label: $t('name'), + align: 'left', + sortable: false, + format: (value: any) => { + return PlaceHolder.replace(value); + }, + }, + { + width: '100%', + name: 'value', + label: $t('value'), + sortable: false, + }, + ], + editor: { + dialog: { + width: '600px', + }, + form: { + colsNum: 1, + fields: [ + { + name: 'name', + label: $t('name'), + type: 'w-code-mirror', + toolbar: false, + lang: 'java', + rows: 1, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + }, + { + name: 'value', + label: $t('value'), + type: 'w-text', + }, + ], + }, + }, + }, + { + colSpan: 6, + firstCol: true, + name: 'httpRequestHeader', + label: $t('re.processor.grid.entity.httpRequestHeader'), + type: 'w-code-mirror', + lang: 'javascript', + rows: 6, + toolbar: false, + placeholder: true, + lineWrap: true, + lineBreak: true, + lineHeight: '1.3rem', + fontSize: '0.75rem', + autoCompletion: this.autoCompletionManager.autoCompletion(), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + }, + { + colSpan: 6, + name: 'httpRequestHeaderParameterValues', + label: $t('re.processor.grid.entity.httpRequestHeaderParameterValues'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-grid', + height: 93, + title: $t('re.processor.grid.entity.httpRequestHeaderParameterValues'), + localMode: true, + autoFetchData: false, + dense: true, + dbClickOperation: 'edit', + dndMode: 'local', + pageable: false, + configButton: false, + toolbarConfigure: { noIcon: false }, + toolbarActions: [ + { + name: 'analyze', + label: $t('analyze'), + icon: 'bi-tag', + click: (args: any) => { + const sql = this.#editorForm.getFieldValue('httpRequestHeader'); + const regex = /\$\{[\u0000-\uFFFF]+?\}/g; + const array: any[] = sql.match(regex); + const rows: any[] = []; + array.forEach((item) => { + rows.push({ name: item, value: '' }); + }); + const grid = this.#editorForm.getFieldComponent('httpRequestHeaderParameterValues'); + grid.setLocalData(rows); + }, + }, + 'separator', + 'add', + 'edit', + [ + { + extend: 'remove', + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpRequestHeaderParameterValues'); + grid.removeRows(args.selecteds); + }, + }, + { + extend: 'remove', + name: 'removeAll', + label: $t('deleteAll'), + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpRequestHeaderParameterValues'); + grid.setLocalData([]); + }, + }, + ], + ], + columns: [ + { + width: '50%', + name: 'name', + label: $t('name'), + align: 'left', + sortable: false, + format: (value: any) => { + return PlaceHolder.replace(value); + }, + }, + { + width: '100%', + name: 'value', + label: $t('value'), + sortable: false, + }, + ], + editor: { + dialog: { + width: '600px', + }, + form: { + colsNum: 1, + fields: [ + { + name: 'name', + label: $t('name'), + type: 'w-code-mirror', + toolbar: false, + lang: 'java', + rows: 1, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + }, + { + name: 'value', + label: $t('value'), + type: 'w-text', + }, + ], + }, + }, + }, + { + colSpan: 6, + name: 'httpRequestBody', + label: $t('re.processor.grid.entity.httpRequestBody'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-code-mirror', + rows: 7, + toolbar: false, + lineNumber: false, + lang: 'json', + lineWrap: false, + lineBreak: true, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + }, + { + colSpan: 6, + name: 'httpRequestBodyParameterValues', + label: $t('re.processor.grid.entity.httpRequestBodyParameterValues'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-grid', + height: 110, + title: $t('re.processor.grid.entity.httpRequestBodyParameterValues'), + localMode: true, + autoFetchData: false, + dense: true, + dbClickOperation: 'edit', + dndMode: 'local', + pageable: false, + configButton: false, + toolbarConfigure: { noIcon: false }, + toolbarActions: [ + { + name: 'send', + label: $t('send'), + icon: 'bi-send', + click: (args: any) => { + const httpMethod = this.#editorForm.getFieldValue('httpMethod'); + const httpUrl = this.#editorForm.getFieldValue('httpUrl'); + const httpAuthType = this.#editorForm.getFieldValue('httpAuthType'); + const httpAuthApikey = this.#editorForm.getFieldValue('httpAuthApikey'); + const httpAuthApiValue = this.#editorForm.getFieldValue('httpAuthApiValue'); + const httpAuthBasicUsername = this.#editorForm.getFieldValue('httpAuthBasicUsername'); + const httpAuthBasicPassword = this.#editorForm.getFieldValue('httpAuthBasicPassword'); + const httpAuthBearerToken = this.#editorForm.getFieldValue('httpAuthBearerToken'); + const httpRequestBody = this.#editorForm.getFieldValue('httpRequestBody'); + + axios + .post(Environment.apiContextPath('/api/re/indicator/processor/sendWebRequest'), { + httpMethod, + httpUrl, + httpAuthType, + httpAuthApikey, + httpAuthApiValue, + httpAuthBasicUsername, + httpAuthBasicPassword, + httpAuthBearerToken, + httpRequestBody, + }) + .then((response) => { + const result = response.data; + if (result.successful) { + this.#httpResponseBodyRef.value = result.content; + } else { + this.#httpResponseBodyRef.value = result.status + ',' + result.error; + } + }); + }, + }, + 'separator', + { + name: 'analyze', + label: $t('analyze'), + icon: 'bi-tag', + click: (args: any) => { + const sql = this.#editorForm.getFieldValue('httpRequestBody'); + const regex = /\$\{[\u0000-\uFFFF]+?\}/g; + const array: any[] = sql.match(regex); + const rows: any[] = []; + array.forEach((item) => { + rows.push({ name: item, value: '' }); + }); + const grid = this.#editorForm.getFieldComponent('httpRequestBodyParameterValues'); + grid.setLocalData(rows); + }, + }, + 'separator', + 'add', + 'edit', + [ + { + extend: 'remove', + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpRequestBodyParameterValues'); + grid.removeRows(args.selecteds); + }, + }, + { + extend: 'remove', + name: 'removeAll', + label: $t('deleteAll'), + click: (args: any) => { + const grid = args.grid.getEditorForm().getFieldComponent('httpRequestBodyParameterValues'); + grid.setLocalData([]); + }, + }, + ], + ], + columns: [ + { + width: '50%', + name: 'name', + label: $t('name'), + align: 'left', + sortable: false, + format: (value: any) => { + return PlaceHolder.replace(value); + }, + }, + { + width: '100%', + name: 'value', + label: $t('value'), + sortable: false, + }, + ], + editor: { + dialog: { + width: '600px', + }, + form: { + colsNum: 1, + fields: [ + { + name: 'name', + label: $t('name'), + type: 'w-code-mirror', + toolbar: false, + lang: 'java', + rows: 1, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + }, + { + name: 'value', + label: $t('value'), + type: 'w-text', + }, + ], + }, + }, + }, + { + colSpan: 12, + name: 'httpResponseBody', + label: $t('re.processor.grid.entity.httpResponseBody'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-code-mirror', + lang: 'json', + rows: 4, + lineHeight: '1.3rem', + fontSize: '0.75rem', + toolbar: false, + lineNumber: false, + lineWrap: false, + lineBreak: true, + modelValue: this.#httpResponseBodyRef.value, + }, + { + colSpan: 12, + name: 'httpResponseMapping', + label: $t('re.processor.grid.entity.httpResponseMapping'), + showIf: (args: any) => { + return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; + }, + type: 'w-code-mirror', + rows: 5, + toolbar: false, + lineNumber: false, + lineHeight: '1.3rem', + fontSize: '0.75rem', + lang: 'java', + lineWrap: false, + lineBreak: true, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + defaultValue: + 'if(${response}.getSuccessful()){\n\t//def object =new groovy.xml.XmlParser().parse(${response}.getContent());\n\tdef object = new groovy.json.JsonSlurper().parseText(${response}.getContent());\n}', + }, + ]; + } + + public getViewerFields(): any { + return [ + { name: 'httpMethod', label: $t('re.processor.grid.entity.httpMethod') }, + { name: 'httpUrl', label: $t('re.processor.grid.entity.httpUrl') }, + { name: 'httpAuthType', label: $t('re.processor.grid.entity.httpAuthType') }, + { name: 'httpAuthApikey', label: $t('re.processor.grid.entity.httpAuthApikey') }, + { name: 'httpAuthApiValue', label: $t('re.processor.grid.entity.httpAuthApiValue') }, + { name: 'httpAuthBasicUsername', label: $t('re.processor.grid.entity.httpAuthBasicUsername') }, + { name: 'httpAuthBasicPassword', label: $t('re.processor.grid.entity.httpAuthBasicPassword') }, + { name: 'httpAuthBearerToken', label: $t('re.processor.grid.entity.httpAuthBearerToken') }, + { name: 'httpRequestBody', label: $t('re.processor.grid.entity.httpRequestBody') }, + { name: 'httpResponseMapping', label: $t('re.processor.grid.entity.httpResponseMapping') }, + ]; + } + + public beforeEditorDataSubmit(args: any): void {} + + public afterEditorOpen(args: any) { + args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + + this.#editorForm = args.grid.getEditorForm(); + EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType', 'io.sc.engine.rule.core.enums.HttpAuthorizationType']).then((value) => { + this.#httpMethodTypeEnum = value.HttpMethodType; + this.#httpMethodTypeOptionsRef.value = Options.enum(this.#httpMethodTypeEnum); + this.#HttpAuthorizationTypeEnum = value.HttpAuthorizationType; + this.#httpAuthorizationTypeOptionsRef.value = Options.enum(this.#HttpAuthorizationTypeEnum); + }); + } +} + +export { HttpRequest }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts index 65785904..8b8faf83 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts @@ -1,15 +1,11 @@ -import { ref, computed } from 'vue'; -import { axios, Environment, $t, Tools, EnumTools, Options } from 'platform-core'; +import { ref } from 'vue'; +import { axios, $t, EnumTools, Options } from 'platform-core'; import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; class HttpRequest extends Processor { - #editorForm: any; - #httpResponseBodyRef = ref(undefined); #httpMethodTypeEnum: any; #httpMethodTypeOptionsRef = ref([]); - #HttpAuthorizationTypeEnum: any; - #httpAuthorizationTypeOptionsRef = ref([]); constructor(targetType: string, context?: any) { super(targetType, context); @@ -40,419 +36,58 @@ class HttpRequest extends Processor { public getEditorFields(): any { return [ { - colSpan: 2, + colSpan: 3, name: 'httpMethod', - label: $t('re.processor.grid.entity.httpMethod'), + label: $t('re.processor.httpRequest.entity.httpMethod'), type: 'w-select', options: this.#httpMethodTypeOptionsRef, - rows: 1, showIf: (args: any) => { return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; }, }, { - colSpan: 2, - name: 'httpAuthType', - label: $t('re.processor.grid.entity.httpAuthType'), - type: 'w-select', - options: this.#httpAuthorizationTypeOptionsRef, - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - }, - { - colSpan: 4, - name: 'httpAuthApikey', - label: $t('re.processor.grid.entity.httpAuthApikey'), - type: 'w-text', - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; - }, - }, - { - colSpan: 4, - name: 'httpAuthApiValue', - label: $t('re.processor.grid.entity.httpAuthApiValue'), - type: 'w-text', - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY'; - }, - }, - { - colSpan: 4, - name: 'httpAuthBasicUsername', - label: $t('re.processor.grid.entity.httpAuthBasicUsername'), - type: 'w-text', - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; - }, - }, - { - colSpan: 4, - name: 'httpAuthBasicPassword', - label: $t('re.processor.grid.entity.httpAuthBasicPassword'), - type: 'w-text', - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH'; - }, - }, - { - colSpan: 8, - name: 'httpAuthBearerToken', - label: $t('re.processor.grid.entity.httpAuthBearerToken'), - type: 'w-text', - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BEARER'; - }, - }, - { - colSpan: 6, - firstCol: true, + colSpan: 9, name: 'httpUrl', - label: $t('re.processor.grid.entity.httpUrl'), - type: 'w-code-mirror', - lang: 'javascript', - rows: 7, - toolbar: false, - placeholder: true, - lineWrap: true, - lineBreak: true, - lineHeight: '1.3rem', - fontSize: '0.75rem', - autoCompletion: this.autoCompletionManager.autoCompletion(), - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - }, - { - colSpan: 6, - name: 'urlParameterValues', - label: $t('re.processor.grid.entity.sqlParameterValues'), - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - type: 'w-grid', - height: 110, - title: $t('re.processor.grid.entity.sqlParameterValues'), - localMode: true, - autoFetchData: false, - dense: true, - dbClickOperation: 'edit', - dndMode: 'local', - pageable: false, - configButton: false, - toolbarConfigure: { noIcon: false }, - toolbarActions: [ - { - name: 'analyze', - label: $t('analyze'), - icon: 'bi-tag', - click: (args: any) => { - const sql = this.#editorForm.getFieldValue('httpUrl'); - const regex = /\$\{[\u0000-\uFFFF]+?\}/g; - const array: any[] = sql.match(regex); - const rows: any[] = []; - array.forEach((item) => { - rows.push({ name: item, value: '' }); - }); - const grid = this.#editorForm.getFieldComponent('urlParameterValues'); - grid.setLocalData(rows); - }, - }, - 'separator', - 'add', - 'edit', - [ - { - extend: 'remove', - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('urlParameterValues'); - grid.removeRows(args.selecteds); - }, - }, - { - extend: 'remove', - name: 'removeAll', - label: $t('deleteAll'), - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('urlParameterValues'); - grid.setLocalData([]); - }, - }, - ], - ], - columns: [ - { - width: '50%', - name: 'name', - label: $t('name'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - width: '100%', - name: 'value', - label: $t('value'), - sortable: false, - }, - ], - editor: { - dialog: { - width: '600px', - }, - form: { - colsNum: 1, - fields: [ - { - name: 'name', - label: $t('name'), - type: 'w-code-mirror', - toolbar: false, - lang: 'java', - rows: 1, - placeholder: true, - autoCompletion: this.autoCompletionManager.autoCompletion(), - }, - { - name: 'value', - label: $t('value'), - type: 'w-text', - }, - ], - }, - }, - }, - { - colSpan: 6, - name: 'httpRequestBody', - label: $t('re.processor.grid.entity.httpRequestBody'), - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - type: 'w-code-mirror', - rows: 7, - toolbar: false, - lineNumber: false, - lang: 'json', - lineWrap: false, - lineBreak: true, - placeholder: true, - autoCompletion: this.autoCompletionManager.autoCompletion(), - userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), - }, - { - colSpan: 6, - name: 'bodyParameterValues', - label: $t('re.processor.grid.entity.sqlParameterValues'), - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - type: 'w-grid', - height: 110, - title: $t('re.processor.grid.entity.sqlParameterValues'), - localMode: true, - autoFetchData: false, - dense: true, - dbClickOperation: 'edit', - dndMode: 'local', - pageable: false, - configButton: false, - toolbarConfigure: { noIcon: false }, - toolbarActions: [ - { - name: 'send', - label: $t('send'), - icon: 'bi-send', - click: (args: any) => { - const httpMethod = this.#editorForm.getFieldValue('httpMethod'); - const httpUrl = this.#editorForm.getFieldValue('httpUrl'); - const httpAuthType = this.#editorForm.getFieldValue('httpAuthType'); - const httpAuthApikey = this.#editorForm.getFieldValue('httpAuthApikey'); - const httpAuthApiValue = this.#editorForm.getFieldValue('httpAuthApiValue'); - const httpAuthBasicUsername = this.#editorForm.getFieldValue('httpAuthBasicUsername'); - const httpAuthBasicPassword = this.#editorForm.getFieldValue('httpAuthBasicPassword'); - const httpAuthBearerToken = this.#editorForm.getFieldValue('httpAuthBearerToken'); - const httpRequestBody = this.#editorForm.getFieldValue('httpRequestBody'); - - axios - .post(Environment.apiContextPath('/api/re/indicator/processor/sendWebRequest'), { - httpMethod, - httpUrl, - httpAuthType, - httpAuthApikey, - httpAuthApiValue, - httpAuthBasicUsername, - httpAuthBasicPassword, - httpAuthBearerToken, - httpRequestBody, - }) - .then((response) => { - const result = response.data; - if (result.successful) { - this.#httpResponseBodyRef.value = result.content; - } else { - this.#httpResponseBodyRef.value = result.status + ',' + result.error; - } - }); - }, - }, - 'separator', - { - name: 'analyze', - label: $t('analyze'), - icon: 'bi-tag', - click: (args: any) => { - const sql = this.#editorForm.getFieldValue('httpRequestBody'); - const regex = /\$\{[\u0000-\uFFFF]+?\}/g; - const array: any[] = sql.match(regex); - const rows: any[] = []; - array.forEach((item) => { - rows.push({ name: item, value: '' }); - }); - const grid = this.#editorForm.getFieldComponent('bodyParameterValues'); - grid.setLocalData(rows); - }, - }, - 'separator', - 'add', - 'edit', - [ - { - extend: 'remove', - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('bodyParameterValues'); - grid.removeRows(args.selecteds); - }, - }, - { - extend: 'remove', - name: 'removeAll', - label: $t('deleteAll'), - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('bodyParameterValues'); - grid.setLocalData([]); - }, - }, - ], - ], - columns: [ - { - width: '50%', - name: 'name', - label: $t('name'), - align: 'left', - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }, - { - width: '100%', - name: 'value', - label: $t('value'), - sortable: false, - }, - ], - editor: { - dialog: { - width: '600px', - }, - form: { - colsNum: 1, - fields: [ - { - name: 'name', - label: $t('name'), - type: 'w-code-mirror', - toolbar: false, - lang: 'java', - rows: 1, - placeholder: true, - autoCompletion: this.autoCompletionManager.autoCompletion(), - }, - { - name: 'value', - label: $t('value'), - type: 'w-text', - }, - ], - }, - }, - }, - { - colSpan: 12, - name: 'httpResponseBody', - label: $t('re.processor.grid.entity.httpResponseBody'), - showIf: (args: any) => { - return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; - }, - type: 'w-code-mirror', - lang: 'json', - rows: 4, - lineHeight: '1.3rem', - fontSize: '0.75rem', - toolbar: false, - lineNumber: false, - lineWrap: false, - lineBreak: true, - modelValue: this.#httpResponseBodyRef.value, - }, - { - colSpan: 12, - name: 'httpResponseMapping', - label: $t('re.processor.grid.entity.httpResponseMapping'), + label: $t('re.processor.httpRequest.entity.httpUrl'), + type: 'w-text', showIf: (args: any) => { return args.form.getFieldValue('type') === this.PROCESSOR_TYPE; }, - type: 'w-code-mirror', - rows: 5, - toolbar: false, - lineNumber: false, - lineHeight: '1.3rem', - fontSize: '0.75rem', - lang: 'java', - lineWrap: false, - lineBreak: true, - placeholder: true, - autoCompletion: this.autoCompletionManager.autoCompletion(), - userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), - defaultValue: - 'if(${response}.getSuccessful()){\n\t//def object =new groovy.xml.XmlParser().parse(${response}.getContent());\n\tdef object = new groovy.json.JsonSlurper().parseText(${response}.getContent());\n}', }, ]; } public getViewerFields(): any { return [ - { name: 'httpMethod', label: $t('re.processor.grid.entity.httpMethod') }, + { name: 'httpMethod', label: $t('re.processor.httpRequest.entity.httpMethod') }, { name: 'httpUrl', label: $t('re.processor.grid.entity.httpUrl') }, - { name: 'httpAuthType', label: $t('re.processor.grid.entity.httpAuthType') }, - { name: 'httpAuthApikey', label: $t('re.processor.grid.entity.httpAuthApikey') }, - { name: 'httpAuthApiValue', label: $t('re.processor.grid.entity.httpAuthApiValue') }, - { name: 'httpAuthBasicUsername', label: $t('re.processor.grid.entity.httpAuthBasicUsername') }, - { name: 'httpAuthBasicPassword', label: $t('re.processor.grid.entity.httpAuthBasicPassword') }, - { name: 'httpAuthBearerToken', label: $t('re.processor.grid.entity.httpAuthBearerToken') }, - { name: 'httpRequestBody', label: $t('re.processor.grid.entity.httpRequestBody') }, - { name: 'httpResponseMapping', label: $t('re.processor.grid.entity.httpResponseMapping') }, + { name: 'httpUrlParameterValues', label: $t('re.processor.httpRequest.entity.httpUrlParameterValues') }, + { name: 'httpAuthType', label: $t('re.processor.httpRequest.entity.httpAuthType') }, + { name: 'httpAuthBasicUsername', label: $t('re.processor.httpRequest.entity.httpAuthBasicUsername') }, + { name: 'httpAuthBasicPassword', label: $t('re.processor.httpRequest.entity.httpAuthBasicPassword') }, + { name: 'httpAuthBearerToken', label: $t('re.processor.httpRequest.entity.httpAuthBearerToken') }, + { name: 'httpAuthParameterValues', label: $t('re.processor.httpRequest.entity.httpAuthParameterValues') }, + { name: 'httpRequestHeader', label: $t('re.processor.httpRequest.entity.httpRequestHeader') }, + { name: 'httpRequestHeaderParameterValues', label: $t('re.processor.httpRequest.entity.httpRequestHeaderParameterValues') }, + { name: 'httpRequestBody', label: $t('re.processor.httpRequest.entity.httpRequestBody') }, + { name: 'httpRequestBodyParameterValues', label: $t('re.processor.httpRequest.entity.httpRequestBodyParameterValues') }, + { name: 'httpConnectTimeout', label: $t('re.processor.httpRequest.entity.httpConnectTimeout') }, + { name: 'httpRetryCountOnFailure', label: $t('re.processor.httpRequest.entity.httpRetryCountOnFailure') }, + { name: 'httpAsync', label: $t('re.processor.httpRequest.entity.httpAsync') }, + { name: 'httpCache', label: $t('re.processor.httpRequest.entity.httpCache') }, + { name: 'httpResponseMapping', label: $t('re.processor.httpRequest.entity.httpResponseMapping') }, ]; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any) { - args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH); this.initAutoCompletionManager(); this.initUserDefinedFunctionsManager(); - this.#editorForm = args.grid.getEditorForm(); EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType', 'io.sc.engine.rule.core.enums.HttpAuthorizationType']).then((value) => { this.#httpMethodTypeEnum = value.HttpMethodType; this.#httpMethodTypeOptionsRef.value = Options.enum(this.#httpMethodTypeEnum); - this.#HttpAuthorizationTypeEnum = value.HttpAuthorizationType; - this.#httpAuthorizationTypeOptionsRef.value = Options.enum(this.#HttpAuthorizationTypeEnum); }); } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/DictionaryEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/DictionaryEntity.java index c49d33e9..753baab1 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/DictionaryEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/DictionaryEntity.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.sc.engine.rule.core.enums.DeployStatus; import io.sc.engine.rule.core.enums.DictionaryType; import io.sc.engine.rule.server.dictionary.vo.DictionaryVo; +import io.sc.platform.core.Environment; import io.sc.platform.core.util.PinyinUtil; import io.sc.platform.orm.DeepClone; import io.sc.platform.orm.IdClearable; @@ -55,8 +56,8 @@ public class DictionaryEntity extends CorporationAuditorEntity imp protected String name; //名称(字母) - @Column(name="NAMEC_", length=1024) - @Size(max=1024) + @Column(name="NAMEC_", length= Environment.PIN_YIN_MAX_LENGTH) + @Size(max=Environment.PIN_YIN_MAX_LENGTH) protected String namec; //描述 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/UserDefinedJavaClassFieldEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/UserDefinedJavaClassFieldEntity.java index 0c01fdb9..d7abf2e5 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/UserDefinedJavaClassFieldEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/dictionary/entity/UserDefinedJavaClassFieldEntity.java @@ -5,6 +5,7 @@ import io.sc.engine.rule.core.util.ExpressionReplacer; import io.sc.engine.rule.server.common.CodeAndNameReplacer; import io.sc.engine.rule.server.common.service.support.ParameterAndValueType; import io.sc.engine.rule.server.dictionary.vo.UserDefinedJavaClassFieldVo; +import io.sc.platform.core.Environment; import io.sc.platform.core.util.PinyinUtil; import io.sc.platform.orm.DeepClone; import io.sc.platform.orm.IdClearable; @@ -43,8 +44,8 @@ public class UserDefinedJavaClassFieldEntity extends CorporationAuditorEntity impleme private String signature; //math xml - @Column(name="MATH_XML_", length=255) - @Size(max=255) + @Column(name="MATH_XML_") private String mathXml; // 函数体 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java index 1fe35e3f..ce24aefb 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java @@ -83,15 +83,20 @@ public class IndicatorProcessorEntityConverter { HttpRequestIndicatorProcessor _po =new HttpRequestIndicatorProcessor(); _po.setHttpMethod(_entity.getHttpMethod()); _po.setHttpUrl(_entity.getHttpUrl()); + _po.setHttpUrlParameterValues(_entity.getHttpUrlParameterValues()); _po.setHttpAuthType(_entity.getHttpAuthType()); - _po.setHttpAuthApikey(_entity.getHttpAuthApikey()); - _po.setHttpAuthApiValue(_entity.getHttpAuthApiValue()); - _po.setHttpAuthApiAddTo(_entity.getHttpAuthApiAddTo()); _po.setHttpAuthBasicUsername(_entity.getHttpAuthBasicUsername()); _po.setHttpAuthBasicPassword(_entity.getHttpAuthBasicPassword()); _po.setHttpAuthBearerToken(_entity.getHttpAuthBearerToken()); - _po.setHttpParams(_entity.getHttpParams()); + _po.setHttpAuthParameterValues(_entity.getHttpAuthParameterValues()); + _po.setHttpRequestHeader(_entity.getHttpRequestHeader()); + _po.setHttpRequestHeaderParameterValues(_entity.getHttpRequestHeaderParameterValues()); _po.setHttpRequestBody(_entity.getHttpRequestBody()); + _po.setHttpRequestBodyParameterValues(_entity.getHttpRequestBodyParameterValues()); + _po.setHttpConnectTimeout(_entity.getHttpConnectTimeout()); + _po.setHttpRetryCountOnFailure(_entity.getHttpRetryCountOnFailure()); + _po.setHttpAsync(_entity.isHttpAsync()); + _po.setHttpCache(_entity.isHttpCache()); _po.setHttpResponseMapping(_entity.getHttpResponseMapping()); po =_po; }else { @@ -191,15 +196,20 @@ public class IndicatorProcessorEntityConverter { HttpRequestIndicatorProcessorEntity _entity =new HttpRequestIndicatorProcessorEntity(); _entity.setHttpMethod(_po.getHttpMethod()); _entity.setHttpUrl(_po.getHttpUrl()); + _entity.setHttpUrlParameterValues(_po.getHttpUrlParameterValues()); _entity.setHttpAuthType(_po.getHttpAuthType()); - _entity.setHttpAuthApikey(_po.getHttpAuthApikey()); - _entity.setHttpAuthApiValue(_po.getHttpAuthApiValue()); - _entity.setHttpAuthApiAddTo(_po.getHttpAuthApiAddTo()); _entity.setHttpAuthBasicUsername(_po.getHttpAuthBasicUsername()); _entity.setHttpAuthBasicPassword(_po.getHttpAuthBasicPassword()); _entity.setHttpAuthBearerToken(_po.getHttpAuthBearerToken()); - _entity.setHttpParams(_po.getHttpParams()); + _entity.setHttpAuthParameterValues(_po.getHttpAuthParameterValues()); + _entity.setHttpRequestHeader(_po.getHttpRequestHeader()); + _entity.setHttpRequestHeaderParameterValues(_po.getHttpRequestHeaderParameterValues()); _entity.setHttpRequestBody(_po.getHttpRequestBody()); + _entity.setHttpRequestBodyParameterValues(_po.getHttpRequestBodyParameterValues()); + _entity.setHttpConnectTimeout(_po.getHttpConnectTimeout()); + _entity.setHttpRetryCountOnFailure(_po.getHttpRetryCountOnFailure()); + _entity.setHttpAsync(_po.isHttpAsync()); + _entity.setHttpCache(_po.isHttpCache()); _entity.setHttpResponseMapping(_po.getHttpResponseMapping()); entity =_entity; }else { diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/LibEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/LibEntity.java index c013eaf5..f75942f4 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/LibEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/LibEntity.java @@ -6,6 +6,7 @@ import io.sc.engine.rule.core.enums.DeployStatus; import io.sc.engine.rule.core.enums.LibType; import io.sc.engine.rule.server.lib.vo.LibVo; import io.sc.engine.rule.server.testcase.entity.LibTestCaseEntity; +import io.sc.platform.core.Environment; import io.sc.platform.core.util.PinyinUtil; import io.sc.platform.orm.DeepClone; import io.sc.platform.orm.IdClearable; @@ -55,8 +56,8 @@ public class LibEntity extends CorporationAuditorEntity implements DeepCl protected String name; //名称(字母) - @Column(name="NAMEC_", length=1024) - @Size(max=1024) + @Column(name="NAMEC_", length=Environment.PIN_YIN_MAX_LENGTH) + @Size(max=Environment.PIN_YIN_MAX_LENGTH) protected String namec; //描述 diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java index 7d4bbf81..7494705a 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java @@ -8,6 +8,7 @@ import io.sc.engine.rule.core.enums.ReplaceMode; import io.sc.engine.rule.server.common.service.support.ParameterAndValueType; import io.sc.engine.rule.server.lib.entity.IndicatorProcessorEntity; import io.sc.engine.rule.server.lib.vo.processor.HttpRequestIndicatorProcessorVo; +import io.sc.platform.orm.converter.NumericBooleanConverter; import javax.persistence.*; @@ -18,47 +19,75 @@ import javax.persistence.*; @DiscriminatorValue("HTTP_REQUEST") @JsonTypeName("HTTP_REQUEST") public class HttpRequestIndicatorProcessorEntity extends IndicatorProcessorEntity { - // Method + // HTTP Method @Column(name="HTTP_METHOD_") @Enumerated(EnumType.STRING) private HttpMethodType httpMethod; - - // Url + + // URL @Column(name="HTTP_URL_") private String httpUrl; - + + // URL 中参数的测试值 + @Column(name="HTTP_URL_PARAMETER_VALUES_") + private String httpUrlParameterValues; + // 认证类型 @Column(name="HTTP_AUTH_TYPE_") @Enumerated(EnumType.STRING) private HttpAuthorizationType httpAuthType; - - // Api Key's key - @Column(name="HTTP_AUTH_API_KEY_") - private String httpAuthApikey; - - // Api Key's value - @Column(name="HTTP_AUTH_API_VALUE_") - private String httpAuthApiValue; - - // Api Key's value - @Column(name="HTTP_AUTH_API_ADDTO_") - private String httpAuthApiAddTo; - + + // Basic 认证的用户名 @Column(name="HTTP_AUTH_BASIC_USERNAME_") private String httpAuthBasicUsername; - + + // Basic 认证的用户密码 @Column(name="HTTP_AUTH_BASIC_PASSWORD_") private String httpAuthBasicPassword; - + + // BearerToken @Column(name="HTTP_AUTH_BEARER_TOKEN_") private String httpAuthBearerToken; - - @Column(name="HTTP_PARAMS_") - private String httpParams; - - @Column(name="HTTP_REQUEST_BODY_") + + // 认证中参数的测试值 + @Column(name="HTTP_AUTH_PARAMETER_VALUES_") + private String httpAuthParameterValues; + + // 请求头 + @Column(name="HTTP_HEADER_") + private String httpRequestHeader; + + // 请求头中参数的测试值 + @Column(name="HTTP_HEADER_PARAMETER_VALUES_") + private String httpRequestHeaderParameterValues; + + // 请求 body + @Column(name="HTTP_BODY_") private String httpRequestBody; - + + // 请求 body 中参数的测试值 + @Column(name="HTTP_BODY_PARAMETER_VALUES_") + private String httpRequestBodyParameterValues; + + // 连接超时毫秒数 + @Column(name="HTTP_CONN_TIMEOUT_") + private int httpConnectTimeout; + + // 失败重试次数 + @Column(name="HTTP_RETRY_COUNT_") + private int httpRetryCountOnFailure; + + // 是否异步执行 + @Column(name="HTTP_IS_ASYNC_") + @Convert(converter= NumericBooleanConverter.class) + private boolean httpAsync; + + // 是否缓存 + @Column(name="HTTP_IS_CACHE_") + @Convert(converter= NumericBooleanConverter.class) + private boolean httpCache; + + // 响应 @Column(name="HTTP_RESPONSE_MAPPING_") private String httpResponseMapping; @@ -67,114 +96,257 @@ public class HttpRequestIndicatorProcessorEntity extends IndicatorProcessorEntit public HttpRequestIndicatorProcessorVo toVo() { HttpRequestIndicatorProcessorVo vo =new HttpRequestIndicatorProcessorVo(); super.toVo(vo); - vo.setType(this.getType()); - vo.setHttpMethod(this.getHttpMethod()); - vo.setHttpUrl(this.getHttpUrl()); - vo.setHttpAuthType(this.getHttpAuthType()); - vo.setHttpAuthApikey(this.getHttpAuthApikey()); - vo.setHttpAuthApiValue(this.getHttpAuthApiValue()); - vo.setHttpAuthApiAddTo(this.getHttpAuthApiAddTo()); - vo.setHttpAuthBasicUsername(this.getHttpAuthBasicUsername()); - vo.setHttpAuthBasicPassword(this.getHttpAuthBasicPassword()); - vo.setHttpAuthBearerToken(this.getHttpAuthBearerToken()); - vo.setHttpParams(this.getHttpParams()); - vo.setHttpRequestBody(this.getHttpRequestBody()); - vo.setHttpResponseMapping(this.getHttpResponseMapping()); + vo.setHttpMethod(httpMethod); + vo.setHttpUrl(httpUrl); + vo.setHttpUrlParameterValues(httpUrlParameterValues); + vo.setHttpAuthType(httpAuthType); + vo.setHttpAuthBasicUsername(httpAuthBasicUsername); + vo.setHttpAuthBasicPassword(httpAuthBasicPassword); + vo.setHttpAuthBearerToken(httpAuthBearerToken); + vo.setHttpAuthParameterValues(httpAuthParameterValues); + vo.setHttpRequestHeader(httpRequestHeader); + vo.setHttpRequestHeaderParameterValues(httpRequestHeaderParameterValues); + vo.setHttpRequestBody(httpRequestBody); + vo.setHttpRequestBodyParameterValues(httpRequestBodyParameterValues); + vo.setHttpConnectTimeout(httpConnectTimeout); + vo.setHttpRetryCountOnFailure(httpRetryCountOnFailure); + vo.setHttpAsync(httpAsync); + vo.setHttpCache(httpCache); + vo.setHttpResponseMapping(httpResponseMapping); return vo; } @Override public ProcessorType getType() { return ProcessorType.HTTP_REQUEST; } + public HttpMethodType getHttpMethod() { return httpMethod; } + public void setHttpMethod(HttpMethodType httpMethod) { this.httpMethod = httpMethod; } + public String getHttpUrl() { return httpUrl; } + public void setHttpUrl(String httpUrl) { this.httpUrl = httpUrl; } + + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; + } + + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; + } + public HttpAuthorizationType getHttpAuthType() { return httpAuthType; } + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { this.httpAuthType = httpAuthType; } - public String getHttpAuthApikey() { - return httpAuthApikey; - } - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; - } - public String getHttpAuthApiValue() { - return httpAuthApiValue; - } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; - } - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; - } - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; - } + public String getHttpAuthBasicUsername() { return httpAuthBasicUsername; } + public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { this.httpAuthBasicUsername = httpAuthBasicUsername; } + public String getHttpAuthBasicPassword() { return httpAuthBasicPassword; } + public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { this.httpAuthBasicPassword = httpAuthBasicPassword; } + public String getHttpAuthBearerToken() { return httpAuthBearerToken; } + public void setHttpAuthBearerToken(String httpAuthBearerToken) { this.httpAuthBearerToken = httpAuthBearerToken; } - public String getHttpParams() { - return httpParams; + + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; + } + + public String getHttpRequestHeader() { + return httpRequestHeader; } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; + } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; + } + + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; + } + public String getHttpRequestBody() { return httpRequestBody; } + public void setHttpRequestBody(String httpRequestBody) { this.httpRequestBody = httpRequestBody; } + + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + public String getHttpResponseMapping() { return httpResponseMapping; } + public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } @Override public boolean replace(ParameterAndValueType parameterAndValueType, ReplaceMode mode) { - String replaced =parameterAndValueType.replace(this.httpParams, mode); + // httpUrl + String replaced =parameterAndValueType.replace(this.httpUrl, mode); replaced =(replaced==null?"":replaced); boolean result =false; - if(!replaced.equals(this.httpParams)) { + if(!replaced.equals(this.httpUrl)) { + result =true; + } + this.httpUrl =replaced; + + // httpUrlParameterValues + replaced =parameterAndValueType.replace(this.httpUrlParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpUrlParameterValues)) { result =true; } - this.httpParams =replaced; - + this.httpUrlParameterValues =replaced; + + // httpAuthBasicUsername; + replaced =parameterAndValueType.replace(this.httpAuthBasicUsername, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthBasicUsername)) { + result =true; + } + this.httpAuthBasicUsername =replaced; + + // httpAuthBasicPassword; + replaced =parameterAndValueType.replace(this.httpAuthBasicPassword, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthBasicPassword)) { + result =true; + } + this.httpAuthBasicPassword =replaced; + + // BearerToken + replaced =parameterAndValueType.replace(this.httpAuthBearerToken, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthBearerToken)) { + result =true; + } + this.httpAuthBearerToken =replaced; + + // httpAuthParameterValues + replaced =parameterAndValueType.replace(this.httpAuthParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthParameterValues)) { + result =true; + } + this.httpAuthParameterValues =replaced; + + // httpRequestHeader + replaced =parameterAndValueType.replace(this.httpRequestHeader, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestHeader)) { + result =true; + } + this.httpRequestHeader =replaced; + + // httpRequestHeaderParameterValues + replaced =parameterAndValueType.replace(this.httpRequestHeaderParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestHeaderParameterValues)) { + result =true; + } + this.httpRequestHeaderParameterValues =replaced; + + // httpRequestBody + replaced =parameterAndValueType.replace(this.httpRequestBody, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestBody)) { + result =true; + } + this.httpRequestBody =replaced; + + // httpRequestBodyParameterValues + replaced =parameterAndValueType.replace(this.httpRequestBodyParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestBodyParameterValues)) { + result =true; + } + this.httpRequestBodyParameterValues =replaced; + + // httpResponseMapping replaced =parameterAndValueType.replace(this.httpResponseMapping, mode); replaced =(replaced==null?"":replaced); if(!replaced.equals(this.httpResponseMapping)) { result =true; } this.httpResponseMapping =replaced; + return result; } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java index 6ba88d87..e2e36057 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java @@ -9,109 +9,161 @@ import io.sc.engine.rule.server.lib.vo.IndicatorProcessorVo; * 指标处理器(Http请求操作)Vo 类 */ public class HttpRequestIndicatorProcessorVo extends IndicatorProcessorVo { - // Method - private HttpMethodType httpMethod; - - // Url - private String httpUrl; - - // 认证类型 - private HttpAuthorizationType httpAuthType; - - // Api Key's key - private String httpAuthApikey; - - // Api Key's value - private String httpAuthApiValue; - - // Api Key's value - private String httpAuthApiAddTo; - - private String httpAuthBasicUsername; - - private String httpAuthBasicPassword; - - private String httpAuthBearerToken; - - private String httpParams; - - private String httpRequestBody; - - private String httpResponseMapping; + private HttpMethodType httpMethod; // HTTP Method + private String httpUrl; // URL + private String httpUrlParameterValues; // URL 中参数的测试值 + private HttpAuthorizationType httpAuthType; // 认证类型 + private String httpAuthBasicUsername; // Basic 认证的用户名 + private String httpAuthBasicPassword; // Basic 认证的用户密码 + private String httpAuthBearerToken; // BearerToken + private String httpAuthParameterValues; // 认证中参数的测试值 + private String httpRequestHeader; // 请求头 + private String httpRequestHeaderParameterValues; // 请求头中参数的测试值 + private String httpRequestBody; // 请求 body + private String httpRequestBodyParameterValues; // 请求 body 中参数的测试值 + private int httpConnectTimeout; // 连接超时毫秒数 + private int httpRetryCountOnFailure; // 失败重试次数 + private boolean httpAsync; // 是否异步执行 + private boolean httpCache; // 是否缓存 + private String httpResponseMapping; // 响应 @Override public ProcessorType getType() { return ProcessorType.HTTP_REQUEST; } + public HttpMethodType getHttpMethod() { return httpMethod; } + public void setHttpMethod(HttpMethodType httpMethod) { this.httpMethod = httpMethod; } + public String getHttpUrl() { return httpUrl; } + public void setHttpUrl(String httpUrl) { this.httpUrl = httpUrl; } + + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; + } + + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; + } + public HttpAuthorizationType getHttpAuthType() { return httpAuthType; } + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { this.httpAuthType = httpAuthType; } - public String getHttpAuthApikey() { - return httpAuthApikey; - } - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; - } - public String getHttpAuthApiValue() { - return httpAuthApiValue; - } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; - } - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; - } - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; - } + public String getHttpAuthBasicUsername() { return httpAuthBasicUsername; } + public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { this.httpAuthBasicUsername = httpAuthBasicUsername; } + public String getHttpAuthBasicPassword() { return httpAuthBasicPassword; } + public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { this.httpAuthBasicPassword = httpAuthBasicPassword; } + public String getHttpAuthBearerToken() { return httpAuthBearerToken; } + public void setHttpAuthBearerToken(String httpAuthBearerToken) { this.httpAuthBearerToken = httpAuthBearerToken; } - public String getHttpParams() { - return httpParams; + + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; + } + + public String getHttpRequestHeader() { + return httpRequestHeader; + } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; + } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; + } + + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; } + public String getHttpRequestBody() { return httpRequestBody; } + public void setHttpRequestBody(String httpRequestBody) { this.httpRequestBody = httpRequestBody; } + + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + public String getHttpResponseMapping() { return httpResponseMapping; } + public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java index e4f88c21..e38c7958 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java @@ -60,15 +60,20 @@ public class ParameterProcessorEntityConverter { HttpRequestParameterProcessor _po =new HttpRequestParameterProcessor(); _po.setHttpMethod(_entity.getHttpMethod()); _po.setHttpUrl(_entity.getHttpUrl()); + _po.setHttpUrlParameterValues(_entity.getHttpUrlParameterValues()); _po.setHttpAuthType(_entity.getHttpAuthType()); - _po.setHttpAuthApikey(_entity.getHttpAuthApikey()); - _po.setHttpAuthApiValue(_entity.getHttpAuthApiValue()); - _po.setHttpAuthApiAddTo(_entity.getHttpAuthApiAddTo()); _po.setHttpAuthBasicUsername(_entity.getHttpAuthBasicUsername()); _po.setHttpAuthBasicPassword(_entity.getHttpAuthBasicPassword()); _po.setHttpAuthBearerToken(_entity.getHttpAuthBearerToken()); - _po.setHttpParams(_entity.getHttpParams()); + _po.setHttpAuthParameterValues(_entity.getHttpAuthParameterValues()); + _po.setHttpRequestHeader(_entity.getHttpRequestHeader()); + _po.setHttpRequestHeaderParameterValues(_entity.getHttpRequestHeaderParameterValues()); _po.setHttpRequestBody(_entity.getHttpRequestBody()); + _po.setHttpRequestBodyParameterValues(_entity.getHttpRequestBodyParameterValues()); + _po.setHttpConnectTimeout(_entity.getHttpConnectTimeout()); + _po.setHttpRetryCountOnFailure(_entity.getHttpRetryCountOnFailure()); + _po.setHttpAsync(_entity.isHttpAsync()); + _po.setHttpCache(_entity.isHttpCache()); _po.setHttpResponseMapping(_entity.getHttpResponseMapping()); po =_po; }else if(entity instanceof MathFormulaParameterProcessorEntity) { @@ -213,15 +218,20 @@ public class ParameterProcessorEntityConverter { HttpRequestParameterProcessorEntity _entity =new HttpRequestParameterProcessorEntity(); _entity.setHttpMethod(_po.getHttpMethod()); _entity.setHttpUrl(_po.getHttpUrl()); + _entity.setHttpUrlParameterValues(_po.getHttpUrlParameterValues()); _entity.setHttpAuthType(_po.getHttpAuthType()); - _entity.setHttpAuthApikey(_po.getHttpAuthApikey()); - _entity.setHttpAuthApiValue(_po.getHttpAuthApiValue()); - _entity.setHttpAuthApiAddTo(_po.getHttpAuthApiAddTo()); _entity.setHttpAuthBasicUsername(_po.getHttpAuthBasicUsername()); _entity.setHttpAuthBasicPassword(_po.getHttpAuthBasicPassword()); _entity.setHttpAuthBearerToken(_po.getHttpAuthBearerToken()); - _entity.setHttpParams(_po.getHttpParams()); + _entity.setHttpAuthParameterValues(_po.getHttpAuthParameterValues()); + _entity.setHttpRequestHeader(_po.getHttpRequestHeader()); + _entity.setHttpRequestHeaderParameterValues(_po.getHttpRequestHeaderParameterValues()); _entity.setHttpRequestBody(_po.getHttpRequestBody()); + _entity.setHttpRequestBodyParameterValues(_po.getHttpRequestBodyParameterValues()); + _entity.setHttpConnectTimeout(_po.getHttpConnectTimeout()); + _entity.setHttpRetryCountOnFailure(_po.getHttpRetryCountOnFailure()); + _entity.setHttpAsync(_po.isHttpAsync()); + _entity.setHttpCache(_po.isHttpCache()); _entity.setHttpResponseMapping(_po.getHttpResponseMapping()); entity =_entity; }else if(po instanceof MathFormulaParameterProcessor) { diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java index bbe3d741..eedb3716 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java @@ -8,6 +8,7 @@ import io.sc.engine.rule.core.enums.ReplaceMode; import io.sc.engine.rule.server.common.service.support.ParameterAndValueType; import io.sc.engine.rule.server.model.entity.ParameterProcessorEntity; import io.sc.engine.rule.server.model.vo.processor.HttpRequestParameterProcessorVo; +import io.sc.platform.orm.converter.NumericBooleanConverter; import javax.persistence.*; @@ -18,47 +19,75 @@ import javax.persistence.*; @DiscriminatorValue("HTTP_REQUEST") @JsonTypeName("HTTP_REQUEST") public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntity { - // Method + // HTTP Method @Column(name="HTTP_METHOD_") @Enumerated(EnumType.STRING) private HttpMethodType httpMethod; - - // Url + + // URL @Column(name="HTTP_URL_") private String httpUrl; - + + // URL 中参数的测试值 + @Column(name="HTTP_URL_PARAMETER_VALUES_") + private String httpUrlParameterValues; + // 认证类型 @Column(name="HTTP_AUTH_TYPE_") @Enumerated(EnumType.STRING) private HttpAuthorizationType httpAuthType; - - // Api Key's key - @Column(name="HTTP_AUTH_API_KEY_") - private String httpAuthApikey; - - // Api Key's value - @Column(name="HTTP_AUTH_API_VALUE_") - private String httpAuthApiValue; - - // Api Key's value - @Column(name="HTTP_AUTH_API_ADDTO_") - private String httpAuthApiAddTo; - + + // Basic 认证的用户名 @Column(name="HTTP_AUTH_BASIC_USERNAME_") private String httpAuthBasicUsername; - + + // Basic 认证的用户密码 @Column(name="HTTP_AUTH_BASIC_PASSWORD_") private String httpAuthBasicPassword; - + + // BearerToken @Column(name="HTTP_AUTH_BEARER_TOKEN_") private String httpAuthBearerToken; - - @Column(name="HTTP_PARAMS_") - private String httpParams; - @Column(name="HTTP_REQUEST_BODY_") + // 认证中参数的测试值 + @Column(name="HTTP_AUTH_PARAMETER_VALUES_") + private String httpAuthParameterValues; + + // 请求头 + @Column(name="HTTP_HEADER_") + private String httpRequestHeader; + + // 请求头中参数的测试值 + @Column(name="HTTP_HEADER_PARAMETER_VALUES_") + private String httpRequestHeaderParameterValues; + + // 请求 body + @Column(name="HTTP_BODY_") private String httpRequestBody; - + + // 请求 body 中参数的测试值 + @Column(name="HTTP_BODY_PARAMETER_VALUES_") + private String httpRequestBodyParameterValues; + + // 连接超时毫秒数 + @Column(name="HTTP_CONN_TIMEOUT_") + private int httpConnectTimeout; + + // 失败重试次数 + @Column(name="HTTP_RETRY_COUNT_") + private int httpRetryCountOnFailure; + + // 是否异步执行 + @Column(name="HTTP_IS_ASYNC_") + @Convert(converter= NumericBooleanConverter.class) + private boolean httpAsync; + + // 是否缓存 + @Column(name="HTTP_IS_CACHE_") + @Convert(converter= NumericBooleanConverter.class) + private boolean httpCache; + + // 响应 @Column(name="HTTP_RESPONSE_MAPPING_") private String httpResponseMapping; @@ -66,18 +95,23 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit public HttpRequestParameterProcessorVo toVo() { HttpRequestParameterProcessorVo vo =new HttpRequestParameterProcessorVo(); super.toVo(vo); - vo.setHttpMethod(this.getHttpMethod()); - vo.setHttpUrl(this.getHttpUrl()); - vo.setHttpAuthType(this.getHttpAuthType()); - vo.setHttpAuthApikey(this.getHttpAuthApikey()); - vo.setHttpAuthApiValue(this.getHttpAuthApiValue()); - vo.setHttpAuthApiAddTo(this.getHttpAuthApiAddTo()); - vo.setHttpAuthBasicUsername(this.getHttpAuthBasicUsername()); - vo.setHttpAuthBasicPassword(this.getHttpAuthBasicPassword()); - vo.setHttpAuthBearerToken(this.getHttpAuthBearerToken()); - vo.setHttpParams(this.getHttpParams()); - vo.setHttpRequestBody(this.getHttpRequestBody()); - vo.setHttpResponseMapping(this.getHttpResponseMapping()); + vo.setHttpMethod(httpMethod); + vo.setHttpUrl(httpUrl); + vo.setHttpUrlParameterValues(httpUrlParameterValues); + vo.setHttpAuthType(httpAuthType); + vo.setHttpAuthBasicUsername(httpAuthBasicUsername); + vo.setHttpAuthBasicPassword(httpAuthBasicPassword); + vo.setHttpAuthBearerToken(httpAuthBearerToken); + vo.setHttpAuthParameterValues(httpAuthParameterValues); + vo.setHttpRequestHeader(httpRequestHeader); + vo.setHttpRequestHeaderParameterValues(httpRequestHeaderParameterValues); + vo.setHttpRequestBody(httpRequestBody); + vo.setHttpRequestBodyParameterValues(httpRequestBodyParameterValues); + vo.setHttpConnectTimeout(httpConnectTimeout); + vo.setHttpRetryCountOnFailure(httpRetryCountOnFailure); + vo.setHttpAsync(httpAsync); + vo.setHttpCache(httpCache); + vo.setHttpResponseMapping(httpResponseMapping); return vo; } @@ -85,156 +119,234 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit public ProcessorType getType() { return ProcessorType.HTTP_REQUEST; } - public HttpMethodType getHttpMethod() { return httpMethod; } - public void setHttpMethod(HttpMethodType httpMethod) { this.httpMethod = httpMethod; } - public String getHttpUrl() { return httpUrl; } - public void setHttpUrl(String httpUrl) { this.httpUrl = httpUrl; } + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; + } + + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; + } public HttpAuthorizationType getHttpAuthType() { return httpAuthType; } - public void setHttpAuthType(HttpAuthorizationType httpAuthType) { this.httpAuthType = httpAuthType; } - - public String getHttpAuthApikey() { - return httpAuthApikey; + public String getHttpAuthBasicUsername() { + return httpAuthBasicUsername; } - - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; + public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { + this.httpAuthBasicUsername = httpAuthBasicUsername; } - - public String getHttpAuthApiValue() { - return httpAuthApiValue; + public String getHttpAuthBasicPassword() { + return httpAuthBasicPassword; } - - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; + public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { + this.httpAuthBasicPassword = httpAuthBasicPassword; } - - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; + public String getHttpAuthBearerToken() { + return httpAuthBearerToken; } - - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; + public void setHttpAuthBearerToken(String httpAuthBearerToken) { + this.httpAuthBearerToken = httpAuthBearerToken; } - - public String getHttpAuthBasicUsername() { - return httpAuthBasicUsername; + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; } + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; + } - public void setHttpAuthBasicUsername(String httpAuthBasicUsername) { - this.httpAuthBasicUsername = httpAuthBasicUsername; + public String getHttpRequestHeader() { + return httpRequestHeader; } + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; + } - public String getHttpAuthBasicPassword() { - return httpAuthBasicPassword; + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; } + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; + } - public void setHttpAuthBasicPassword(String httpAuthBasicPassword) { - this.httpAuthBasicPassword = httpAuthBasicPassword; + public String getHttpRequestBody() { + return httpRequestBody; } + public void setHttpRequestBody(String httpRequestBody) { + this.httpRequestBody = httpRequestBody; + } - public String getHttpAuthBearerToken() { - return httpAuthBearerToken; + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; } + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } - public void setHttpAuthBearerToken(String httpAuthBearerToken) { - this.httpAuthBearerToken = httpAuthBearerToken; + public int getHttpConnectTimeout() { + return httpConnectTimeout; } + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } - public String getHttpParams() { - return httpParams; + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; } + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + public boolean isHttpAsync() { + return httpAsync; } + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } - public String getHttpRequestBody() { - return httpRequestBody; + public boolean isHttpCache() { + return httpCache; } - public void setHttpRequestBody(String httpRequestBody) { - this.httpRequestBody = httpRequestBody; + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; } public String getHttpResponseMapping() { return httpResponseMapping; } - public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } - @Override public boolean replace(ParameterAndValueType parameterAndValueType, ReplaceMode mode) { - String replaced =parameterAndValueType.replace(this.httpParams, mode); + // httpUrl + String replaced =parameterAndValueType.replace(this.httpUrl, mode); replaced =(replaced==null?"":replaced); boolean result =false; - if(!replaced.equals(this.httpParams)) { + if(!replaced.equals(this.httpUrl)) { result =true; } - this.httpParams =replaced; - - replaced =parameterAndValueType.replace(this.httpResponseMapping, mode); + this.httpUrl =replaced; + + // httpUrlParameterValues + replaced =parameterAndValueType.replace(this.httpUrlParameterValues, mode); replaced =(replaced==null?"":replaced); - if(!replaced.equals(this.httpResponseMapping)) { + if(!replaced.equals(this.httpUrlParameterValues)) { result =true; } - this.httpResponseMapping =replaced; + this.httpUrlParameterValues =replaced; - replaced =parameterAndValueType.replace(this.httpUrl, mode); + // httpAuthBasicUsername; + replaced =parameterAndValueType.replace(this.httpAuthBasicUsername, mode); replaced =(replaced==null?"":replaced); - if(!replaced.equals(this.httpUrl)) { + if(!replaced.equals(this.httpAuthBasicUsername)) { result =true; } - this.httpUrl =replaced; + this.httpAuthBasicUsername =replaced; + // httpAuthBasicPassword; + replaced =parameterAndValueType.replace(this.httpAuthBasicPassword, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthBasicPassword)) { + result =true; + } + this.httpAuthBasicPassword =replaced; + + // BearerToken + replaced =parameterAndValueType.replace(this.httpAuthBearerToken, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthBearerToken)) { + result =true; + } + this.httpAuthBearerToken =replaced; + + // httpAuthParameterValues + replaced =parameterAndValueType.replace(this.httpAuthParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpAuthParameterValues)) { + result =true; + } + this.httpAuthParameterValues =replaced; + + // httpRequestHeader + replaced =parameterAndValueType.replace(this.httpRequestHeader, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestHeader)) { + result =true; + } + this.httpRequestHeader =replaced; + + // httpRequestHeaderParameterValues + replaced =parameterAndValueType.replace(this.httpRequestHeaderParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestHeaderParameterValues)) { + result =true; + } + this.httpRequestHeaderParameterValues =replaced; + + // httpRequestBody replaced =parameterAndValueType.replace(this.httpRequestBody, mode); replaced =(replaced==null?"":replaced); if(!replaced.equals(this.httpRequestBody)) { result =true; } this.httpRequestBody =replaced; + + // httpRequestBodyParameterValues + replaced =parameterAndValueType.replace(this.httpRequestBodyParameterValues, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpRequestBodyParameterValues)) { + result =true; + } + this.httpRequestBodyParameterValues =replaced; + + // httpResponseMapping + replaced =parameterAndValueType.replace(this.httpResponseMapping, mode); + replaced =(replaced==null?"":replaced); + if(!replaced.equals(this.httpResponseMapping)) { + result =true; + } + this.httpResponseMapping =replaced; + return result; } } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java index e7864e33..465297c9 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java @@ -9,35 +9,23 @@ import io.sc.engine.rule.server.model.vo.ParameterProcessorVo; * 模型参数处理器(Http 请求操作)Vo 类 */ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo { - // Method - private HttpMethodType httpMethod; - - // Url - private String httpUrl; - - // 认证类型 - private HttpAuthorizationType httpAuthType; - - // Api Key's key - private String httpAuthApikey; - - // Api Key's value - private String httpAuthApiValue; - - // Api Key's value - private String httpAuthApiAddTo; - - private String httpAuthBasicUsername; - - private String httpAuthBasicPassword; - - private String httpAuthBearerToken; - - private String httpParams; - - private String httpRequestBody; - - private String httpResponseMapping; + private HttpMethodType httpMethod; // HTTP Method + private String httpUrl; // URL + private String httpUrlParameterValues; // URL 中参数的测试值 + private HttpAuthorizationType httpAuthType; // 认证类型 + private String httpAuthBasicUsername; // Basic 认证的用户名 + private String httpAuthBasicPassword; // Basic 认证的用户密码 + private String httpAuthBearerToken; // BearerToken + private String httpAuthParameterValues; // 认证中参数的测试值 + private String httpRequestHeader; // 请求头 + private String httpRequestHeaderParameterValues; // 请求头中参数的测试值 + private String httpRequestBody; // 请求 body + private String httpRequestBodyParameterValues; // 请求 body 中参数的测试值 + private int httpConnectTimeout; // 连接超时毫秒数 + private int httpRetryCountOnFailure; // 失败重试次数 + private boolean httpAsync; // 是否异步执行 + private boolean httpCache; // 是否缓存 + private String httpResponseMapping; // 响应 @Override public ProcessorType getType() { @@ -60,36 +48,20 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo { this.httpUrl = httpUrl; } - public HttpAuthorizationType getHttpAuthType() { - return httpAuthType; - } - - public void setHttpAuthType(HttpAuthorizationType httpAuthType) { - this.httpAuthType = httpAuthType; - } - - public String getHttpAuthApikey() { - return httpAuthApikey; - } - - public void setHttpAuthApikey(String httpAuthApikey) { - this.httpAuthApikey = httpAuthApikey; + public String getHttpUrlParameterValues() { + return httpUrlParameterValues; } - public String getHttpAuthApiValue() { - return httpAuthApiValue; + public void setHttpUrlParameterValues(String httpUrlParameterValues) { + this.httpUrlParameterValues = httpUrlParameterValues; } - public void setHttpAuthApiValue(String httpAuthApiValue) { - this.httpAuthApiValue = httpAuthApiValue; - } - - public String getHttpAuthApiAddTo() { - return httpAuthApiAddTo; + public HttpAuthorizationType getHttpAuthType() { + return httpAuthType; } - public void setHttpAuthApiAddTo(String httpAuthApiAddTo) { - this.httpAuthApiAddTo = httpAuthApiAddTo; + public void setHttpAuthType(HttpAuthorizationType httpAuthType) { + this.httpAuthType = httpAuthType; } public String getHttpAuthBasicUsername() { @@ -116,12 +88,28 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo { this.httpAuthBearerToken = httpAuthBearerToken; } - public String getHttpParams() { - return httpParams; + public String getHttpAuthParameterValues() { + return httpAuthParameterValues; + } + + public void setHttpAuthParameterValues(String httpAuthParameterValues) { + this.httpAuthParameterValues = httpAuthParameterValues; + } + + public String getHttpRequestHeader() { + return httpRequestHeader; + } + + public void setHttpRequestHeader(String httpRequestHeader) { + this.httpRequestHeader = httpRequestHeader; + } + + public String getHttpRequestHeaderParameterValues() { + return httpRequestHeaderParameterValues; } - public void setHttpParams(String httpParams) { - this.httpParams = httpParams; + public void setHttpRequestHeaderParameterValues(String httpRequestHeaderParameterValues) { + this.httpRequestHeaderParameterValues = httpRequestHeaderParameterValues; } public String getHttpRequestBody() { @@ -132,6 +120,46 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo { this.httpRequestBody = httpRequestBody; } + public String getHttpRequestBodyParameterValues() { + return httpRequestBodyParameterValues; + } + + public void setHttpRequestBodyParameterValues(String httpRequestBodyParameterValues) { + this.httpRequestBodyParameterValues = httpRequestBodyParameterValues; + } + + public int getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(int httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public int getHttpRetryCountOnFailure() { + return httpRetryCountOnFailure; + } + + public void setHttpRetryCountOnFailure(int httpRetryCountOnFailure) { + this.httpRetryCountOnFailure = httpRetryCountOnFailure; + } + + public boolean isHttpAsync() { + return httpAsync; + } + + public void setHttpAsync(boolean httpAsync) { + this.httpAsync = httpAsync; + } + + public boolean isHttpCache() { + return httpCache; + } + + public void setHttpCache(boolean httpCache) { + this.httpCache = httpCache; + } + public String getHttpResponseMapping() { return httpResponseMapping; } @@ -139,5 +167,4 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo { public void setHttpResponseMapping(String httpResponseMapping) { this.httpResponseMapping = httpResponseMapping; } - } diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java index ee9ad6fc..e88fbd2b 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java @@ -7,6 +7,7 @@ import io.sc.engine.rule.core.enums.DeployStatus; import io.sc.engine.rule.core.enums.ResourceType; import io.sc.engine.rule.server.resource.vo.ResourceVo; import io.sc.engine.rule.server.testcase.entity.ResourceTestCaseEntity; +import io.sc.platform.core.Environment; import io.sc.platform.core.util.PinyinUtil; import io.sc.platform.core.constraints.IdentifierConstraint; import io.sc.platform.orm.DeepClone; @@ -61,8 +62,8 @@ public class ResourceEntity extends CorporationAuditorEntity impleme protected String name; //名称 - @Column(name="NAMEC_", length=1024) - @Size(max=1024) + @Column(name="NAMEC_", length= Environment.PIN_YIN_MAX_LENGTH) + @Size(max=Environment.PIN_YIN_MAX_LENGTH) protected String namec; //描述 diff --git a/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml b/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml index 5cde41c0..a75a1659 100644 --- a/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml +++ b/io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml @@ -20,7 +20,7 @@ - + @@ -378,15 +378,20 @@ + - - - - - + + + + + + + + + @@ -449,7 +454,7 @@ - + @@ -506,7 +511,7 @@ - + @@ -618,7 +623,7 @@ - + @@ -790,15 +795,20 @@ + - - - - - + + + + + + + + + @@ -941,7 +951,7 @@ - + diff --git a/io.sc.engine.st.frontend/package.json b/io.sc.engine.st.frontend/package.json index 90582eb3..9f289d6e 100644 --- a/io.sc.engine.st.frontend/package.json +++ b/io.sc.engine.st.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.engine.st.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.ai.frontend/package.json b/io.sc.platform.ai.frontend/package.json index 2ba901df..eba95b4c 100644 --- a/io.sc.platform.ai.frontend/package.json +++ b/io.sc.platform.ai.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.ai.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 25556dd1..b5d76735 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.70", + "version": "8.2.71", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts index de067500..89872089 100644 --- a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts +++ b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts @@ -59,6 +59,15 @@ class Tools { return obj === null || typeof obj === 'undefined' || obj === ''; } + /** + * 判断一个对象是否是布尔值 + * @param obj 对象 + * @returns 对象是否是布尔值 + */ + public static isBoolean(obj: any): boolean { + return 'boolean' === typeof obj; + } + /** * 判断一个对象是否是字符串 * @param obj 对象 diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 6c569248..3a73087d 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.2.70", + "version": "8.2.71", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.6", "pinia": "2.3.0", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/Environment.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/Environment.java index 4ba1e172..ea8f8e7c 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/Environment.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/Environment.java @@ -17,6 +17,7 @@ public class Environment { public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public static final String DEFAULT_CHARSET_NAME = StandardCharsets.UTF_8.name(); public static final String DEFAULT_URL_ENCODE_NAME = StandardCharsets.UTF_8.name(); + public static final int PIN_YIN_MAX_LENGTH =700; public static final String KEY_APPLICATION_NAME ="application.name"; public static final String KEY_IS_RUNNING_IN_DEVELOPMENT ="application.is-running-in-development"; public static final String KEY_IS_RUNNING_IN_WEB_CONTAINER ="application.is-running-in-web-container"; diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/PinyinUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/PinyinUtil.java index 381f56c5..a8512c59 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/PinyinUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/PinyinUtil.java @@ -72,7 +72,9 @@ public class PinyinUtil { return chinese; } String[] array =getPinYinArray(chinese); - return StringUtil.combine("",array); + String result =StringUtil.combine("",array); + int length =result.length(); + return result.substring(0,length>Environment.PIN_YIN_MAX_LENGTH?Environment.PIN_YIN_MAX_LENGTH:length); } public static String pinyinOnlyFirst(String chinese) { @@ -96,7 +98,9 @@ public class PinyinUtil { for(String pinyin : array) { sb.append(pinyin.substring(0, 1).toUpperCase()).append(pinyin.substring(1)); } - return sb.toString(); + String result =sb.toString(); + int length =result.length(); + return result.substring(0,length>Environment.PIN_YIN_MAX_LENGTH?Environment.PIN_YIN_MAX_LENGTH:length); } private static String[] getPinYinArray(String chinese) { @@ -212,8 +216,4 @@ public class PinyinUtil { } return pinyin(o1).compareTo(pinyin(o2)); } - - public static void main(String[] args) { - System.out.println(pinyin("重庆")); - } } diff --git a/io.sc.platform.developer.doc/package.json b/io.sc.platform.developer.doc/package.json index 1d6de35b..f32b6883 100644 --- a/io.sc.platform.developer.doc/package.json +++ b/io.sc.platform.developer.doc/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.doc", - "version": "8.2.13", + "version": "8.2.14", "description": "", "main": "index.js", "scripts": { @@ -28,7 +28,7 @@ "vuepress": "2.0.0-rc.15" }, "dependencies": { - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "vue": "3.5.13", "vue-i18n": "11.0.1" diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index 00ec4188..8a0588a3 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/io.sc.platform.developer.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.lcdp.frontend/package.json b/io.sc.platform.lcdp.frontend/package.json index 526f5db1..e597cc43 100644 --- a/io.sc.platform.lcdp.frontend/package.json +++ b/io.sc.platform.lcdp.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.lcdp.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.license.keygen.frontend/package.json b/io.sc.platform.license.keygen.frontend/package.json index b4cc5d2b..1d8a9eac 100644 --- a/io.sc.platform.license.keygen.frontend/package.json +++ b/io.sc.platform.license.keygen.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.license.keygen.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.mvc.frontend/package.json b/io.sc.platform.mvc.frontend/package.json index 320d7502..049c08ef 100644 --- a/io.sc.platform.mvc.frontend/package.json +++ b/io.sc.platform.mvc.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.mvc.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.scheduler.manager.frontend/package.json b/io.sc.platform.scheduler.manager.frontend/package.json index d6c1cc17..438fa242 100644 --- a/io.sc.platform.scheduler.manager.frontend/package.json +++ b/io.sc.platform.scheduler.manager.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.scheduler.manager.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index 319c86a2..1876c094 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/io.sc.platform.system.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.system.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -111,7 +111,7 @@ "mockjs": "1.1.0", "node-sql-parser": "5.3.6", "pinia": "2.3.0", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.standard.frontend/package.json b/io.sc.standard.frontend/package.json index bd29048a..e32ebf29 100644 --- a/io.sc.standard.frontend/package.json +++ b/io.sc.standard.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.standard.frontend", - "version": "8.2.13", + "version": "8.2.14", "description": "", "private": false, "keywords": [], @@ -112,7 +112,7 @@ "node-sql-parser": "5.3.6", "pinia": "2.3.0", "pinia-undo": "0.2.4", - "platform-core": "8.2.70", + "platform-core": "8.2.71", "quasar": "2.17.6", "sort-array": "5.0.0", "svg-path-commander": "2.1.7", diff --git a/io.sc.website/package.json b/io.sc.website/package.json index c21c6c38..629691f4 100644 --- a/io.sc.website/package.json +++ b/io.sc.website/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.website", - "version": "8.2.12", + "version": "8.2.14", "description": "", "main": "index.js", "scripts": { @@ -28,6 +28,6 @@ }, "dependencies": { "vue": "3.5.13", - "platform-core": "8.2.70" + "platform-core": "8.2.71" } } \ No newline at end of file