diff --git a/changelog.md b/changelog.md
index e44fb401..a9df5053 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
# changelog
+## 4.2.6
+
+- 优化网关超时处理
+
## 4.2.5
- 修复restful负载均衡问题
diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md
index c3b62b4b..26ca5140 100644
--- a/doc/docs/_sidebar.md
+++ b/doc/docs/_sidebar.md
@@ -1,34 +1,35 @@
-* [首页](/?t=1606133657136)
+* [首页](/?t=1613961608243)
* 开发文档
- * [快速体验](files/10010_快速体验.md?t=1606133657138)
- * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1606133657161)
- * [新增接口](files/10020_新增接口.md?t=1606133657161)
- * [开发流程](files/10021_开发流程.md?t=1606133657161)
- * [业务参数校验](files/10030_业务参数校验.md?t=1606133657161)
- * [错误处理](files/10040_错误处理.md?t=1606133657161)
- * [编写文档](files/10041_编写文档.md?t=1606133657162)
- * [接口交互详解](files/10050_接口交互详解.md?t=1606133657162)
- * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1606133657162)
- * [ISV管理](files/10085_ISV管理.md?t=1606133657162)
- * [自定义返回结果](files/10087_自定义返回结果.md?t=1606133657162)
- * [自定义过滤器](files/10088_自定义过滤器.md?t=1606133657162)
- * [自定义校验token](files/10089_自定义校验token.md?t=1606133657162)
- * [网关拦截器](files/10090_网关拦截器.md?t=1606133657163)
- * [路由授权](files/10091_路由授权.md?t=1606133657163)
- * [接口限流](files/10092_接口限流.md?t=1606133657163)
- * [路由监控](files/10093_路由监控.md?t=1606133657163)
- * [SDK开发](files/10095_SDK开发.md?t=1606133657163)
- * [应用授权](files/10097_应用授权.md?t=1606133657163)
- * [提供restful接口](files/10100_提供restful接口.md?t=1606133657163)
- * [文件上传](files/10104_文件上传.md?t=1606133657163)
- * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1606133657164)
- * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1606133657164)
- * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1606133657164)
- * [使用eureka](files/10112_使用eureka.md?t=1606133657164)
+ * [快速体验](files/10010_快速体验.md?t=1613961608246)
+ * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1613961608270)
+ * [新增接口](files/10020_新增接口.md?t=1613961608270)
+ * [开发流程](files/10021_开发流程.md?t=1613961608270)
+ * [业务参数校验](files/10030_业务参数校验.md?t=1613961608270)
+ * [错误处理](files/10040_错误处理.md?t=1613961608271)
+ * [编写文档](files/10041_编写文档.md?t=1613961608271)
+ * [接口交互详解](files/10050_接口交互详解.md?t=1613961608271)
+ * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1613961608271)
+ * [ISV管理](files/10085_ISV管理.md?t=1613961608271)
+ * [自定义返回结果](files/10087_自定义返回结果.md?t=1613961608271)
+ * [自定义过滤器](files/10088_自定义过滤器.md?t=1613961608271)
+ * [自定义校验token](files/10089_自定义校验token.md?t=1613961608271)
+ * [网关拦截器](files/10090_网关拦截器.md?t=1613961608271)
+ * [路由授权](files/10091_路由授权.md?t=1613961608272)
+ * [接口限流](files/10092_接口限流.md?t=1613961608272)
+ * [路由监控](files/10093_路由监控.md?t=1613961608272)
+ * [SDK开发](files/10095_SDK开发.md?t=1613961608272)
+ * [应用授权](files/10097_应用授权.md?t=1613961608272)
+ * [提供restful接口](files/10100_提供restful接口.md?t=1613961608272)
+ * [文件上传](files/10104_文件上传.md?t=1613961608272)
+ * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1613961608273)
+ * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1613961608273)
+ * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1613961608273)
+ * [使用eureka](files/10112_使用eureka.md?t=1613961608273)
+ * [超时设置](files/10113_超时设置.md?t=1613961608273)
* 原理分析
- * [网关性能测试](files/90001_网关性能测试.md?t=1606133657164)
- * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1606133657164)
- * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1606133657164)
- * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1606133657164)
- * [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1606133657165)
- * [常见问题](files/90100_常见问题.md?t=1606133657165)
+ * [网关性能测试](files/90001_网关性能测试.md?t=1613961608273)
+ * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1613961608273)
+ * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1613961608273)
+ * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1613961608274)
+ * [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1613961608274)
+ * [常见问题](files/90100_常见问题.md?t=1613961608274)
diff --git a/doc/docs/files/10113_超时设置.md b/doc/docs/files/10113_超时设置.md
new file mode 100644
index 00000000..89a1081e
--- /dev/null
+++ b/doc/docs/files/10113_超时设置.md
@@ -0,0 +1,14 @@
+# 超时设置
+
+当微服务处理业务逻辑时间过长,网关会报超时错误,默认等待时间是5秒。
+
+可在网关指定`spring.cloud.gateway.httpclient.response-timeout`参数设置超时时间,单位毫秒
+
+```properties
+# 设置响应超时10秒
+spring.cloud.gateway.httpclient.response-timeout=10000
+```
+
+更多配置参见:`org.springframework.cloud.gateway.config.HttpClientProperties`
+
+测试用例参见:`com.gitee.sop.test.TimeoutTest`
diff --git a/doc/pom.xml b/doc/pom.xml
index 3f273928..f8c59034 100644
--- a/doc/pom.xml
+++ b/doc/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.gitee.sop
doc
- 4.2.5-SNAPSHOT
+ ${revision}
diff --git a/pom.xml b/pom.xml
index c507b1ff..123dab3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
4.0.0
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
pom
一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台
@@ -29,6 +29,8 @@
+
+ 4.2.6-SNAPSHOT
1.8
UTF-8
diff --git a/sop-admin/pom.xml b/sop-admin/pom.xml
index 390c6d7d..5aaa3325 100644
--- a/sop-admin/pom.xml
+++ b/sop-admin/pom.xml
@@ -6,13 +6,12 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
4.0.0
sop-admin
- 4.2.5-SNAPSHOT
pom
diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml
index 575a8a77..ee34436e 100644
--- a/sop-admin/sop-admin-server/pom.xml
+++ b/sop-admin/sop-admin-server/pom.xml
@@ -5,13 +5,13 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
sop-admin-server
- 4.2.5-SNAPSHOT
+ ${revision}
jar
diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml
index 3efbe934..3dba2faf 100644
--- a/sop-auth/pom.xml
+++ b/sop-auth/pom.xml
@@ -5,7 +5,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
@@ -25,7 +25,7 @@
com.gitee.sop
sop-service-common
- 4.2.5-SNAPSHOT
+ ${project.version}
@@ -38,7 +38,7 @@
com.gitee.sop
sdk-java
- 4.2.5-SNAPSHOT
+ ${revision}
diff --git a/sop-common/pom.xml b/sop-common/pom.xml
index 185b01de..a8fdaf9e 100644
--- a/sop-common/pom.xml
+++ b/sop-common/pom.xml
@@ -6,7 +6,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
diff --git a/sop-common/sop-bridge-eureka/pom.xml b/sop-common/sop-bridge-eureka/pom.xml
index 1378df0d..65881046 100644
--- a/sop-common/sop-bridge-eureka/pom.xml
+++ b/sop-common/sop-bridge-eureka/pom.xml
@@ -5,20 +5,18 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
- 4.2.5-SNAPSHOT
-
sop-bridge-eureka
com.gitee.sop
sop-gateway-common
- 4.2.5-SNAPSHOT
+ ${project.version}
diff --git a/sop-common/sop-bridge-nacos/pom.xml b/sop-common/sop-bridge-nacos/pom.xml
index 60a5e3d9..e30c9732 100644
--- a/sop-common/sop-bridge-nacos/pom.xml
+++ b/sop-common/sop-bridge-nacos/pom.xml
@@ -5,20 +5,18 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
- 4.2.5-SNAPSHOT
-
sop-bridge-nacos
com.gitee.sop
sop-gateway-common
- 4.2.5-SNAPSHOT
+ ${project.version}
diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml
index 005dfab8..0fd8678f 100644
--- a/sop-common/sop-gateway-common/pom.xml
+++ b/sop-common/sop-gateway-common/pom.xml
@@ -5,13 +5,12 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
sop-gateway-common
- 4.2.5-SNAPSHOT
jar
diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java
index 65d9fe45..25f46393 100644
--- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java
+++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java
@@ -14,6 +14,7 @@ import com.gitee.sop.gatewaycommon.result.BaseExecutorAdapter;
import com.gitee.sop.gatewaycommon.result.ResultExecutorForGateway;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.ServiceInstance;
+import org.springframework.cloud.gateway.support.TimeoutException;
import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@@ -84,7 +85,9 @@ public class GatewayResultExecutor extends BaseExecutorAdapter
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
sop-service-common
- 4.2.5-SNAPSHOT
+ ${revision}
jar
diff --git a/sop-example/pom.xml b/sop-example/pom.xml
index 0c11d667..ca8f4529 100644
--- a/sop-example/pom.xml
+++ b/sop-example/pom.xml
@@ -5,7 +5,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml
index 5e07ef3f..6a641b6f 100644
--- a/sop-example/sop-springmvc/pom.xml
+++ b/sop-example/sop-springmvc/pom.xml
@@ -5,7 +5,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
@@ -26,7 +26,7 @@
com.gitee.sop
sop-service-common
- 4.2.5-SNAPSHOT
+ ${project.version}
diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml
index d4310bff..40d7a3f7 100644
--- a/sop-example/sop-story/pom.xml
+++ b/sop-example/sop-story/pom.xml
@@ -4,7 +4,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
@@ -19,7 +19,7 @@
com.gitee.sop
sop-service-common
- 4.2.5-SNAPSHOT
+ ${project.version}
diff --git a/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1009_TimeoutController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1009_TimeoutController.java
new file mode 100644
index 00000000..0079893f
--- /dev/null
+++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1009_TimeoutController.java
@@ -0,0 +1,29 @@
+package com.gitee.sop.storyweb.controller;
+
+import com.gitee.sop.servercommon.annotation.Open;
+import com.gitee.sop.storyweb.controller.param.StoryParam;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 模拟超时设置
+ *
+ * @author tanghc
+ */
+@RestController
+public class Example1009_TimeoutController {
+
+ @Open("goods.timeout")
+ @RequestMapping("timeoutTest")
+ public Object timeout(StoryParam param) {
+ // 模拟耗时操作,耗时10秒
+ try {
+ TimeUnit.SECONDS.sleep(10);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return param;
+ }
+}
diff --git a/sop-gateway/pom.xml b/sop-gateway/pom.xml
index 3c1d31cc..acab069b 100644
--- a/sop-gateway/pom.xml
+++ b/sop-gateway/pom.xml
@@ -4,7 +4,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
@@ -24,7 +24,7 @@
com.gitee.sop
sop-bridge-nacos
- 4.2.5-SNAPSHOT
+ ${project.version}
diff --git a/sop-gateway/src/main/resources/application-dev.properties b/sop-gateway/src/main/resources/application-dev.properties
index 28af61d7..4a154c25 100644
--- a/sop-gateway/src/main/resources/application-dev.properties
+++ b/sop-gateway/src/main/resources/application-dev.properties
@@ -1,15 +1,18 @@
-# 更多配置,见:META-INF/gateway.properties
+# \u66F4\u591A\u914D\u7F6E\uFF0C\u89C1\uFF1AMETA-INF/gateway.properties
server.port=8081
-# mysql数据库配置
+# mysql\u6570\u636E\u5E93\u914D\u7F6E
mysql.host=localhost:3306
mysql.username=root
mysql.password=root
-# nacos注册中心地址
+# nacos\u6CE8\u518C\u4E2D\u5FC3\u5730\u5740
register.url=127.0.0.1:8848
-# 上传文件最大容量,默认10MB
+# \u4E0A\u4F20\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF0C\u9ED8\u8BA410MB
spring.servlet.multipart.max-file-size=10MB
-logging.level.com.gitee=debug
\ No newline at end of file
+# \u54CD\u5E94\u8D85\u65F6\uFF0C\u9ED8\u8BA45\u79D2\uFF085000\uFF09
+#spring.cloud.gateway.httpclient.response-timeout=5000
+
+logging.level.com.gitee=debug
diff --git a/sop-sdk/pom.xml b/sop-sdk/pom.xml
index fa2f495c..9ccc9594 100644
--- a/sop-sdk/pom.xml
+++ b/sop-sdk/pom.xml
@@ -6,13 +6,12 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
4.0.0
sop-sdk
- 4.2.5-SNAPSHOT
pom
diff --git a/sop-sdk/sdk-java/pom.xml b/sop-sdk/sdk-java/pom.xml
index 4e3d28ad..a51bb56f 100644
--- a/sop-sdk/sdk-java/pom.xml
+++ b/sop-sdk/sdk-java/pom.xml
@@ -4,13 +4,13 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../../pom.xml
4.0.0
sdk-java
- 4.2.5-SNAPSHOT
+ ${revision}
diff --git a/sop-test/pom.xml b/sop-test/pom.xml
index 9c11677a..2af643a5 100644
--- a/sop-test/pom.xml
+++ b/sop-test/pom.xml
@@ -5,7 +5,7 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
diff --git a/sop-test/src/main/java/com/gitee/sop/test/HttpTool.java b/sop-test/src/main/java/com/gitee/sop/test/HttpTool.java
index b285a443..9530bc0c 100644
--- a/sop-test/src/main/java/com/gitee/sop/test/HttpTool.java
+++ b/sop-test/src/main/java/com/gitee/sop/test/HttpTool.java
@@ -75,15 +75,15 @@ public class HttpTool {
/**
* 请求超时时间
*/
- private int connectTimeoutSeconds = 10;
+ private int connectTimeoutSeconds = 60;
/**
* http读取超时时间
*/
- private int readTimeoutSeconds = 10;
+ private int readTimeoutSeconds = 60;
/**
* http写超时时间
*/
- private int writeTimeoutSeconds = 10;
+ private int writeTimeoutSeconds = 60;
}
/**
diff --git a/sop-test/src/test/java/com/gitee/sop/test/TimeoutTest.java b/sop-test/src/test/java/com/gitee/sop/test/TimeoutTest.java
new file mode 100644
index 00000000..cbd537fe
--- /dev/null
+++ b/sop-test/src/test/java/com/gitee/sop/test/TimeoutTest.java
@@ -0,0 +1,65 @@
+package com.gitee.sop.test;
+
+import com.alibaba.fastjson.JSON;
+import com.gitee.sop.test.alipay.AlipaySignature;
+import org.junit.Test;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 超时测试
+ */
+public class TimeoutTest extends TestBase {
+
+ String url = "http://localhost:8081";
+ String appId = "2019032617262200001";
+ // 平台提供的私钥
+ String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXJv1pQFqWNA/++OYEV7WYXwexZK/J8LY1OWlP9X0T6wHFOvxNKRvMkJ5544SbgsJpVcvRDPrcxmhPbi/sAhdO4x2PiPKIz9Yni2OtYCCeaiE056B+e1O2jXoLeXbfi9fPivJZkxH/tb4xfLkH3bA8ZAQnQsoXA0SguykMRZntF0TndUfvDrLqwhlR8r5iRdZLB6F8o8qXH6UPDfNEnf/K8wX5T4EB1b8x8QJ7Ua4GcIUqeUxGHdQpzNbJdaQvoi06lgccmL+PHzminkFYON7alj1CjDN833j7QMHdPtS9l7B67fOU/p2LAAkPMtoVBfxQt9aFj7B8rEhGCz02iJIBAgMBAAECggEARqOuIpY0v6WtJBfmR3lGIOOokLrhfJrGTLF8CiZMQha+SRJ7/wOLPlsH9SbjPlopyViTXCuYwbzn2tdABigkBHYXxpDV6CJZjzmRZ+FY3S/0POlTFElGojYUJ3CooWiVfyUMhdg5vSuOq0oCny53woFrf32zPHYGiKdvU5Djku1onbDU0Lw8w+5tguuEZ76kZ/lUcccGy5978FFmYpzY/65RHCpvLiLqYyWTtaNT1aQ/9pw4jX9HO9NfdJ9gYFK8r/2f36ZE4hxluAfeOXQfRC/WhPmiw/ReUhxPznG/WgKaa/OaRtAx3inbQ+JuCND7uuKeRe4osP2jLPHPP6AUwQKBgQDUNu3BkLoKaimjGOjCTAwtp71g1oo+k5/uEInAo7lyEwpV0EuUMwLA/HCqUgR4K9pyYV+Oyb8d6f0+Hz0BMD92I2pqlXrD7xV2WzDvyXM3s63NvorRooKcyfd9i6ccMjAyTR2qfLkxv0hlbBbsPHz4BbU63xhTJp3Ghi0/ey/1HQKBgQC2VsgqC6ykfSidZUNLmQZe3J0p/Qf9VLkfrQ+xaHapOs6AzDU2H2osuysqXTLJHsGfrwVaTs00ER2z8ljTJPBUtNtOLrwNRlvgdnzyVAKHfOgDBGwJgiwpeE9voB1oAV/mXqSaUWNnuwlOIhvQEBwekqNyWvhLqC7nCAIhj3yvNQKBgQCqYbeec56LAhWP903Zwcj9VvG7sESqXUhIkUqoOkuIBTWFFIm54QLTA1tJxDQGb98heoCIWf5x/A3xNI98RsqNBX5JON6qNWjb7/dobitti3t99v/ptDp9u8JTMC7penoryLKK0Ty3bkan95Kn9SC42YxaSghzqkt+uvfVQgiNGQKBgGxU6P2aDAt6VNwWosHSe+d2WWXt8IZBhO9d6dn0f7ORvcjmCqNKTNGgrkewMZEuVcliueJquR47IROdY8qmwqcBAN7Vg2K7r7CPlTKAWTRYMJxCT1Hi5gwJb+CZF3+IeYqsJk2NF2s0w5WJTE70k1BSvQsfIzAIDz2yE1oPHvwVAoGAA6e+xQkVH4fMEph55RJIZ5goI4Y76BSvt2N5OKZKd4HtaV+eIhM3SDsVYRLIm9ZquJHMiZQGyUGnsvrKL6AAVNK7eQZCRDk9KQz+0GKOGqku0nOZjUbAu6A2/vtXAaAuFSFx1rUQVVjFulLexkXR3KcztL1Qu2k5pB6Si0K/uwQ=";
+
+ // sop-gateway/src/main/resources/application-dev.properties中配置参数:
+ // spring.cloud.gateway.httpclient.response-timeout=11000
+ // 响应超时11秒
+ // 业务逻辑处理10秒,见:com.gitee.sop.storyweb.controller.Example1009_TimeoutController
+ // 把spring.cloud.gateway.httpclient.response-timeout值改成5000网关会报错
+ @Test
+ public void testGet() throws Exception {
+
+ // 公共请求参数
+ Map params = new HashMap();
+ params.put("app_id", appId);
+ params.put("method", "goods.timeout");
+ params.put("format", "json");
+ params.put("charset", "utf-8");
+ params.put("sign_type", "RSA2");
+ params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
+ params.put("version", "1.0");
+
+ // 业务参数
+ Map bizContent = new HashMap<>();
+ bizContent.put("id", "1");
+ bizContent.put("name", "葫芦娃");
+
+ params.put("biz_content", JSON.toJSONString(bizContent));
+ String content = AlipaySignature.getSignContent(params);
+ String sign = AlipaySignature.rsa256Sign(content, privateKey, "utf-8");
+ params.put("sign", sign);
+
+ System.out.println("----------- 请求信息 -----------");
+ System.out.println("请求参数:" + buildParamQuery(params));
+ System.out.println("商户秘钥:" + privateKey);
+ System.out.println("待签名内容:" + content);
+ System.out.println("签名(sign):" + sign);
+ System.out.println("URL参数:" + buildUrlQuery(params));
+
+ System.out.println("----------- 返回结果 -----------");
+ long start = System.currentTimeMillis();
+ String responseData = get(url, params);// 发送请求
+ System.out.printf("耗时:%s秒%n", (System.currentTimeMillis() - start) / 1000.0);
+ System.out.println(responseData);
+ }
+
+
+}
diff --git a/sop-website/pom.xml b/sop-website/pom.xml
index d90b17ee..cff744e3 100644
--- a/sop-website/pom.xml
+++ b/sop-website/pom.xml
@@ -6,13 +6,12 @@
com.gitee.sop
sop-parent
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
4.0.0
sop-website
- 4.2.5-SNAPSHOT
pom
diff --git a/sop-website/sop-website-server/pom.xml b/sop-website/sop-website-server/pom.xml
index 0a2c0f13..f0acc782 100644
--- a/sop-website/sop-website-server/pom.xml
+++ b/sop-website/sop-website-server/pom.xml
@@ -5,7 +5,7 @@
com.gitee.sop
sop-website
- 4.2.5-SNAPSHOT
+ ${revision}
../pom.xml
@@ -25,7 +25,7 @@
com.gitee.sop
sop-bridge-nacos
- 4.2.5-SNAPSHOT
+ ${project.version}