Merge branch 'hotfix'

# Conflicts:
#	changelog.md
1.x
tanghc 5 years ago
commit 64d79ba3eb
  1. 4
      changelog.md
  2. 2
      sop-admin/sop-admin-server/pom.xml
  3. 2
      sop-common/pom.xml
  4. 4
      sop-common/sop-gateway-common/pom.xml
  5. 2
      sop-common/sop-registry-api/pom.xml
  6. 4
      sop-common/sop-service-common/pom.xml
  7. 10
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/AlipayServiceConfiguration.java
  8. 24
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java
  9. 2
      sop-example/sop-auth/pom.xml
  10. 2
      sop-example/sop-book/sop-book-web/pom.xml
  11. 2
      sop-example/sop-easyopen/pom.xml
  12. 2
      sop-example/sop-springmvc/pom.xml
  13. 2
      sop-example/sop-story/sop-story-web/pom.xml
  14. 3
      sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
  15. 2
      sop-gateway/pom.xml
  16. 2
      sop-website/website-server/pom.xml

@ -1,5 +1,9 @@
# changelog
## 1.13.6
- 修复@RequestBody不能绑定问题
## 1.13.5
- 修复postJson下version获取不到问题

@ -30,7 +30,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-registry-api</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<!-- easyopen starter -->

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>

@ -5,11 +5,11 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sop-gateway-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sop-gateway-common</name>

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-registry-api</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -6,11 +6,11 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sop-service-common</name>

@ -3,11 +3,8 @@ package com.gitee.sop.servercommon.configuration;
import com.gitee.sop.servercommon.bean.ServiceConfig;
import com.gitee.sop.servercommon.param.SopHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import java.util.List;
/**
* 具备支付宝开放平台服务提供能力
* @author tanghc
@ -22,13 +19,6 @@ public class AlipayServiceConfiguration extends BaseServiceConfiguration {
@Autowired
private RequestMappingHandlerAdapter requestMappingHandlerAdapter;
@Override
protected void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
SopHandlerMethodArgumentResolver sopHandlerMethodArgumentResolver = ServiceConfig.getInstance().getMethodArgumentResolver();
argumentResolvers.add(sopHandlerMethodArgumentResolver);
}
@Override
protected void doAfter() {
super.doAfter();

@ -17,12 +17,15 @@ import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
/**
@ -42,14 +45,29 @@ public class ApiArgumentResolver implements SopHandlerMethodArgumentResolver {
@Override
public void setRequestMappingHandlerAdapter(RequestMappingHandlerAdapter requestMappingHandlerAdapter) {
this.requestMappingHandlerAdapter = requestMappingHandlerAdapter;
List<HandlerMethodArgumentResolver> argumentResolversNew = new ArrayList<>(64);
// 先加自己
argumentResolversNew.add(this);
HandlerMethodArgumentResolver lastOne = null;
for (HandlerMethodArgumentResolver argumentResolver : Objects.requireNonNull(requestMappingHandlerAdapter.getArgumentResolvers())) {
// RequestResponseBodyMethodProcessor暂存起来,放在最后面
if (argumentResolver instanceof RequestResponseBodyMethodProcessor) {
lastOne = argumentResolver;
} else {
argumentResolversNew.add(argumentResolver);
}
}
if (lastOne != null) {
argumentResolversNew.add(lastOne);
}
this.requestMappingHandlerAdapter.setArgumentResolvers(argumentResolversNew);
}
@Override
public boolean supportsParameter(MethodParameter methodParameter) {
boolean hasAnnotation = methodParameter.getMethodAnnotation(ApiMapping.class) != null
|| methodParameter.getMethodAnnotation(ApiAbility.class) != null;
// 有注解
return hasAnnotation;
return methodParameter.getMethodAnnotation(ApiMapping.class) != null
|| methodParameter.getMethodAnnotation(ApiAbility.class) != null;
}
@Override

@ -26,7 +26,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>

@ -24,7 +24,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gitee.sop</groupId>

@ -29,7 +29,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>

@ -20,7 +20,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<!-- eureka 服务发现 -->
<dependency>

@ -24,7 +24,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gitee.sop</groupId>

@ -6,6 +6,7 @@ import com.gitee.sop.servercommon.bean.OpenContext;
import com.gitee.sop.story.api.domain.Story;
import com.gitee.sop.storyweb.controller.param.StoryParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
@ -23,7 +24,7 @@ public class PostJsonController {
* @return
*/
@ApiMapping("demo.post.json")
public Story postJson(StoryParam param) {
public Story postJson(@RequestBody StoryParam param) {
// 获取开放平台请求参数
OpenContext openContext = ServiceContext.getCurrentContext().getOpenContext();
List<Object> params = Arrays.asList(

@ -23,7 +23,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-gateway-common</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<!-- ↓↓↓ 使用spring cloud zuul ↓↓↓ -->

@ -25,7 +25,7 @@
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-registry-api</artifactId>
<version>1.13.5-SNAPSHOT</version>
<version>1.13.6-SNAPSHOT</version>
</dependency>
<dependency>

Loading…
Cancel
Save