From 31202908a48c19a110516fadf878279f4a86c79d Mon Sep 17 00:00:00 2001 From: tanghc Date: Thu, 1 Apr 2021 18:11:07 +0800 Subject: [PATCH] 4.3.4 --- changelog.md | 4 ++++ doc/pom.xml | 2 +- pom.xml | 2 +- sop-admin/pom.xml | 2 +- sop-admin/sop-admin-server/pom.xml | 4 ++-- sop-auth/pom.xml | 4 ++-- sop-common/pom.xml | 2 +- sop-common/sop-bridge-eureka/pom.xml | 2 +- sop-common/sop-bridge-nacos/pom.xml | 2 +- sop-common/sop-gateway-common/pom.xml | 2 +- sop-common/sop-service-common/pom.xml | 4 ++-- .../param/ApiArgumentResolver.java | 6 +++++- sop-example/pom.xml | 2 +- sop-example/sop-springmvc/pom.xml | 2 +- sop-example/sop-story/pom.xml | 2 +- .../controller/Example1001_BaseController.java | 7 +++++++ sop-gateway/pom.xml | 2 +- sop-sdk/pom.xml | 2 +- sop-sdk/sdk-java/pom.xml | 4 ++-- sop-test/pom.xml | 2 +- .../java/com/gitee/sop/test/AllInOneTest.java | 18 ++++++++++++++++++ sop-website/pom.xml | 2 +- sop-website/sop-website-server/pom.xml | 2 +- 23 files changed, 57 insertions(+), 24 deletions(-) diff --git a/changelog.md b/changelog.md index cc75923a..64fde0d5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # changelog +## 4.3.4 + +- 修复Request参数在第一位导致绑定失败问题 + ## 4.3.3 - 修复获取eureka地址问题 diff --git a/doc/pom.xml b/doc/pom.xml index 013ab197..0f98db76 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.gitee.sop doc - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT diff --git a/pom.xml b/pom.xml index f836a77d..63d90efd 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ 4.0.0 com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT pom 一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台 diff --git a/sop-admin/pom.xml b/sop-admin/pom.xml index 19844931..6c881c8c 100644 --- a/sop-admin/pom.xml +++ b/sop-admin/pom.xml @@ -6,7 +6,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index a71df6de..c34d9993 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.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../../pom.xml 4.0.0 sop-admin-server - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT jar diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml index 63ab0b0c..286e88f3 100644 --- a/sop-auth/pom.xml +++ b/sop-auth/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml @@ -38,7 +38,7 @@ com.gitee.sop sdk-java - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT diff --git a/sop-common/pom.xml b/sop-common/pom.xml index 2a8b8094..e18fcf21 100644 --- a/sop-common/pom.xml +++ b/sop-common/pom.xml @@ -6,7 +6,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-common/sop-bridge-eureka/pom.xml b/sop-common/sop-bridge-eureka/pom.xml index 43ecc47d..908d0640 100644 --- a/sop-common/sop-bridge-eureka/pom.xml +++ b/sop-common/sop-bridge-eureka/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-common - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml 4.0.0 diff --git a/sop-common/sop-bridge-nacos/pom.xml b/sop-common/sop-bridge-nacos/pom.xml index dbe621cf..ca0ba208 100644 --- a/sop-common/sop-bridge-nacos/pom.xml +++ b/sop-common/sop-bridge-nacos/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-common - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml 4.0.0 diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml index 71cf8133..d297e88d 100644 --- a/sop-common/sop-gateway-common/pom.xml +++ b/sop-common/sop-gateway-common/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-common - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-common/sop-service-common/pom.xml b/sop-common/sop-service-common/pom.xml index 9b866a95..20f0c533 100644 --- a/sop-common/sop-service-common/pom.xml +++ b/sop-common/sop-service-common/pom.xml @@ -6,13 +6,13 @@ com.gitee.sop sop-common - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml 4.0.0 sop-service-common - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT jar diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java index abb95648..3ba68ccf 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java @@ -209,7 +209,11 @@ public class ApiArgumentResolver implements SopHandlerMethodArgumentResolver { */ protected Object getParamObject(MethodParameter methodParameter, NativeWebRequest nativeWebRequest) { HttpServletRequest request = (HttpServletRequest) nativeWebRequest.getNativeRequest(); - OpenContextImpl openContext = initOpenContextImpl(nativeWebRequest); + ServiceContext currentContext = ServiceContext.getCurrentContext(); + OpenContextImpl openContext = (OpenContextImpl)currentContext.getOpenContext(); + if (openContext == null) { + openContext = initOpenContextImpl(nativeWebRequest); + } Map requestParams = openContext.getParameterMap(); Object bizObj = requestParams.get(ParamNames.BIZ_CONTENT_NAME); String bizContent = bizObj == null ? null : bizObj.toString(); diff --git a/sop-example/pom.xml b/sop-example/pom.xml index 4807f5aa..3060f4a6 100644 --- a/sop-example/pom.xml +++ b/sop-example/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml index 3bec76ce..56b153fa 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.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../../pom.xml diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml index 880d76db..a3ba74e0 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.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../../pom.xml diff --git a/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1001_BaseController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1001_BaseController.java index 9745245c..28839f3e 100644 --- a/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1001_BaseController.java +++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1001_BaseController.java @@ -9,6 +9,7 @@ import com.gitee.sop.servercommon.bean.ServiceContext; import com.gitee.sop.servercommon.exception.ServiceException; import com.gitee.sop.storyweb.controller.param.ArrayElementParam; import com.gitee.sop.storyweb.controller.param.CategoryParam; +import com.gitee.sop.storyweb.controller.param.GoodsParam; import com.gitee.sop.storyweb.controller.param.LargeTextParam; import com.gitee.sop.storyweb.controller.param.MemberInfoGetParam; import com.gitee.sop.storyweb.controller.param.StoryParam; @@ -132,6 +133,12 @@ public class Example1001_BaseController { return result; } + @Open("story.system.param.get4") + @RequestMapping("/get/system/param/v4") + public Object addGoods3(HttpServletRequest request, StoryParam param) { + return param; + } + // 参数绑定,少量参数可以这样写,参数多了建议放进类里面 @Open(value = "story.oneparam") @GetMapping("/oneParam/v1") diff --git a/sop-gateway/pom.xml b/sop-gateway/pom.xml index 8ab218a4..86d2f79c 100644 --- a/sop-gateway/pom.xml +++ b/sop-gateway/pom.xml @@ -4,7 +4,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-sdk/pom.xml b/sop-sdk/pom.xml index 785b7d08..390ad294 100644 --- a/sop-sdk/pom.xml +++ b/sop-sdk/pom.xml @@ -6,7 +6,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-sdk/sdk-java/pom.xml b/sop-sdk/sdk-java/pom.xml index fadd82d4..51fb751d 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.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../../pom.xml 4.0.0 sdk-java - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT diff --git a/sop-test/pom.xml b/sop-test/pom.xml index b11acf42..82e06234 100644 --- a/sop-test/pom.xml +++ b/sop-test/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java b/sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java index dc8a9320..23a56d2e 100644 --- a/sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java +++ b/sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java @@ -404,6 +404,24 @@ public class AllInOneTest extends TestBase { client.execute(requestBuilder); } + public void testParamBind() { + Client.RequestBuilder requestBuilder = new Client.RequestBuilder() + .method("story.system.param.get4") + .version("1.0") + .bizContent(new BizContent().add("id", "1").add("name", "葫芦娃")) + .postJson(true) + .httpMethod(HttpTool.HTTPMethod.POST) + .callback((requestInfo, responseData) -> { + System.out.println(responseData); + String node = requestInfo.getDataNode(); + JSONObject jsonObject = JSON.parseObject(responseData).getJSONObject(node); + Assert.assertEquals(1L, jsonObject.getLongValue("id")); + Assert.assertEquals("葫芦娃", jsonObject.getString("name")); + }); + + client.execute(requestBuilder); + } + static class BizContent extends HashMap { public BizContent add(String key, Object value) { this.put(key, value); diff --git a/sop-website/pom.xml b/sop-website/pom.xml index b69c90f0..922f62b6 100644 --- a/sop-website/pom.xml +++ b/sop-website/pom.xml @@ -6,7 +6,7 @@ com.gitee.sop sop-parent - 4.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml diff --git a/sop-website/sop-website-server/pom.xml b/sop-website/sop-website-server/pom.xml index a1239e92..1ae6ac7f 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.3.3-SNAPSHOT + 4.3.4-SNAPSHOT ../pom.xml