From 4c1197e1815cd84d3e2673e6e7d9f188801af513 Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 29 Jul 2020 11:18:45 +0800 Subject: [PATCH] 4.0.0 --- README.md | 50 ++++++++++++++++++- sop-admin/sop-admin-server/pom.xml | 2 +- sop-auth/pom.xml | 2 +- sop-common/pom.xml | 1 - sop-common/sop-bridge-eureka/pom.xml | 4 +- sop-common/sop-bridge-nacos/pom.xml | 5 +- sop-common/sop-gateway-common/pom.xml | 2 +- sop-common/sop-service-common/pom.xml | 2 +- sop-example/sop-springmvc/pom.xml | 2 +- sop-example/sop-story/pom.xml | 2 +- sop-gateway/pom.xml | 2 +- .../gitee/sop/test/AlipayClientPostTest.java | 2 - sop-website/pom.xml | 2 +- 13 files changed, 62 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3acda6c4..bb1f0f9a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,54 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处 以上情况都可以考虑使用SOP +```java +// 加一个注解即可 +@Open("story.get") +@RequestMapping("/get") +public StoryResult get() { + StoryResult result = new StoryResult(); + result.setId(1L); + result.setName("海底小纵队(原生)"); + return result; +} +``` + +调用: + +```java +// 公共请求参数 +Map params = new HashMap(); +params.put("app_id", appId); +params.put("method", "story.get"); +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)); + +System.out.println("----------- 请求信息 -----------"); +System.out.println("请求参数:" + buildParamQuery(params)); +System.out.println("商户秘钥:" + privateKey); +String content = AlipaySignature.getSignContent(params); +System.out.println("待签名内容:" + content); +String sign = AlipaySignature.rsa256Sign(content, privateKey, "utf-8"); +System.out.println("签名(sign):" + sign); + +params.put("sign", sign); +System.out.println("URL参数:" + buildUrlQuery(params)); + +System.out.println("----------- 返回结果 -----------"); +String responseData = get(url, params);// 发送请求 +System.out.println(responseData); +``` + ## 架构图 ![架构图](https://images.gitee.com/uploads/images/2019/1227/145216_c9b45109_332975.png "sop3.png") @@ -81,7 +129,7 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处 ## 分支说明 -- master:发版分支(当前为3.0版本,2.x版本见`2.x`分支) +- master:发版分支(当前为4.0版本) - develop:日常开发分支 - eureka:使用eureka注册中心 diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index 9d779dc8..a79ceb4f 100644 --- a/sop-admin/sop-admin-server/pom.xml +++ b/sop-admin/sop-admin-server/pom.xml @@ -24,7 +24,7 @@ com.gitee.sop sop-bridge-nacos - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml index 09f02e60..4b461acf 100644 --- a/sop-auth/pom.xml +++ b/sop-auth/pom.xml @@ -25,7 +25,7 @@ com.gitee.sop sop-service-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-common/pom.xml b/sop-common/pom.xml index 9fc2f485..56da2b7e 100644 --- a/sop-common/pom.xml +++ b/sop-common/pom.xml @@ -12,7 +12,6 @@ 4.0.0 sop-common - 3.2.0-SNAPSHOT pom diff --git a/sop-common/sop-bridge-eureka/pom.xml b/sop-common/sop-bridge-eureka/pom.xml index ead99a7b..4cc70680 100644 --- a/sop-common/sop-bridge-eureka/pom.xml +++ b/sop-common/sop-bridge-eureka/pom.xml @@ -10,7 +10,7 @@ 4.0.0 - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT sop-bridge-eureka @@ -18,7 +18,7 @@ com.gitee.sop sop-gateway-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-common/sop-bridge-nacos/pom.xml b/sop-common/sop-bridge-nacos/pom.xml index 6b5f547b..3b3f2f6b 100644 --- a/sop-common/sop-bridge-nacos/pom.xml +++ b/sop-common/sop-bridge-nacos/pom.xml @@ -8,8 +8,9 @@ 1.0.0-SNAPSHOT ../../pom.xml + 4.0.0 - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT sop-bridge-nacos @@ -17,7 +18,7 @@ com.gitee.sop sop-gateway-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml index 82bd2131..90e474f5 100644 --- a/sop-common/sop-gateway-common/pom.xml +++ b/sop-common/sop-gateway-common/pom.xml @@ -11,7 +11,7 @@ 4.0.0 sop-gateway-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT jar diff --git a/sop-common/sop-service-common/pom.xml b/sop-common/sop-service-common/pom.xml index a9c89991..385a2271 100644 --- a/sop-common/sop-service-common/pom.xml +++ b/sop-common/sop-service-common/pom.xml @@ -12,7 +12,7 @@ 4.0.0 sop-service-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT jar diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml index a241b294..6fbac49a 100644 --- a/sop-example/sop-springmvc/pom.xml +++ b/sop-example/sop-springmvc/pom.xml @@ -26,7 +26,7 @@ com.gitee.sop sop-service-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml index 3aafff93..a86b8180 100644 --- a/sop-example/sop-story/pom.xml +++ b/sop-example/sop-story/pom.xml @@ -19,7 +19,7 @@ com.gitee.sop sop-service-common - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-gateway/pom.xml b/sop-gateway/pom.xml index a4ebbf3d..86616b09 100644 --- a/sop-gateway/pom.xml +++ b/sop-gateway/pom.xml @@ -24,7 +24,7 @@ com.gitee.sop sop-bridge-nacos - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT diff --git a/sop-test/src/test/java/com/gitee/sop/test/AlipayClientPostTest.java b/sop-test/src/test/java/com/gitee/sop/test/AlipayClientPostTest.java index 56eb2ad0..22b0c91d 100644 --- a/sop-test/src/test/java/com/gitee/sop/test/AlipayClientPostTest.java +++ b/sop-test/src/test/java/com/gitee/sop/test/AlipayClientPostTest.java @@ -36,8 +36,6 @@ public class AlipayClientPostTest extends TestBase { @Test public void testGet() throws Exception { - // 接口实现见:com.gitee.sop.storyweb.controller.AlipayController.getStory - // 公共请求参数 Map params = new HashMap(); params.put("app_id", appId); diff --git a/sop-website/pom.xml b/sop-website/pom.xml index aa7c6213..6371e741 100644 --- a/sop-website/pom.xml +++ b/sop-website/pom.xml @@ -25,7 +25,7 @@ com.gitee.sop sop-bridge-nacos - 3.2.0-SNAPSHOT + 4.0.0-SNAPSHOT