Merge branch 'master' into eureka

eureka
tanghc 4 years ago
commit 1adca817e3
  1. 4
      changelog.md
  2. 11
      doc/docs/files/10011_项目接入到SOP.md
  3. 2
      doc/pom.xml
  4. 2
      pom.xml
  5. 2
      sop-admin/pom.xml
  6. 4
      sop-admin/sop-admin-server/pom.xml
  7. 4
      sop-auth/pom.xml
  8. 2
      sop-common/pom.xml
  9. 2
      sop-common/sop-bridge-eureka/pom.xml
  10. 2
      sop-common/sop-bridge-nacos/pom.xml
  11. 2
      sop-common/sop-gateway-common/pom.xml
  12. 14
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/ServiceRouteListener.java
  13. 4
      sop-common/sop-service-common/pom.xml
  14. 2
      sop-example/pom.xml
  15. 2
      sop-example/sop-springmvc/pom.xml
  16. 2
      sop-example/sop-story/pom.xml
  17. 2
      sop-gateway/pom.xml
  18. 2
      sop-sdk/pom.xml
  19. 4
      sop-sdk/sdk-java/pom.xml
  20. 2
      sop-test/pom.xml
  21. 2
      sop-website/pom.xml
  22. 2
      sop-website/sop-website-server/pom.xml

@ -1,5 +1,9 @@
# changelog # changelog
## 4.3.1
- 修复serviceId有大小写出现404问题
## 4.3.0 ## 4.3.0
- 升级`spring-boot/spring-cloud/spring-cloud-alibaba`版本 - 升级`spring-boot/spring-cloud/spring-cloud-alibaba`版本

@ -6,13 +6,12 @@
```xml ```xml
<!-- springboot 版本--> <!-- springboot 版本-->
<spring-boot.version>2.1.8.RELEASE</spring-boot.version> <spring-boot.version>2.3.2.RELEASE</spring-boot.version>
<!-- spring cloud 版本 --> <!-- spring cloud 版本 -->
<spring-cloud.version>Greenwich.SR6</spring-cloud.version> <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
<!-- spring cloud alibaba 版本 --> <!-- spring cloud alibaba 版本 -->
<!-- 具体版本对应关系见:https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E --> <!-- 具体版本对应关系见:https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E -->
<spring-cloud-alibaba.version>2.1.2.RELEASE</spring-cloud-alibaba.version> <spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version>
``` ```
- pom.xml添加`<dependencyManagement>`控制版本 - pom.xml添加`<dependencyManagement>`控制版本
@ -94,6 +93,8 @@ public class OpenServiceConfig extends AlipayServiceConfiguration {
php应用提供的接口需要返回如下json内容: php应用提供的接口需要返回如下json内容:
假设请求的接口为:`http://open.xxx.com/get_routes`
```json ```json
{ {
"serviceId": "goods-service", "serviceId": "goods-service",
@ -158,7 +159,7 @@ instance.setServiceName("goods-service");
instance.setIp("192.168.0.11"); instance.setIp("192.168.0.11");
instance.setPort(8080); instance.setPort(8080);
// 在nacos的metadata中指定接口路径 // 在nacos的metadata中指定接口路径
instance.getMetadata().put("sop.routes.path", "/goods/list_goods"); instance.getMetadata().put("sop.routes.path", "http://open.xxx.com/get_routes");
namingService.registerInstance(serviceId, instance); namingService.registerInstance(serviceId, instance);
``` ```

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>doc</artifactId> <artifactId>doc</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<properties> <properties>
<!-- Generic properties --> <!-- Generic properties -->

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台</description> <description>一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台</description>

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -5,13 +5,13 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>sop-admin-server</artifactId> <artifactId>sop-admin-server</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
@ -37,7 +37,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sdk-java</artifactId> <artifactId>sdk-java</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
</dependency> </dependency>
<!-- http请求 --> <!-- http请求 -->
<dependency> <dependency>

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -45,13 +45,25 @@ public class ServiceRouteListener extends BaseServiceListener {
ResponseEntity<String> responseEntity = getRestTemplate().getForEntity(url, String.class); ResponseEntity<String> responseEntity = getRestTemplate().getForEntity(url, String.class);
if (responseEntity.getStatusCode() == HttpStatus.OK) { if (responseEntity.getStatusCode() == HttpStatus.OK) {
String body = responseEntity.getBody(); String body = responseEntity.getBody();
ServiceRouteInfo serviceRouteInfo = JSON.parseObject(body, ServiceRouteInfo.class); ServiceRouteInfo serviceRouteInfo;
try {
serviceRouteInfo = this.parseServiceRouteInfo(body);
} catch (Exception e) {
log.error("解析路由配置错误,body:{}", body, e);
return;
}
gatewayRouteCache.load(serviceRouteInfo, callback -> routesProcessor.saveRoutes(serviceRouteInfo, instance)); gatewayRouteCache.load(serviceRouteInfo, callback -> routesProcessor.saveRoutes(serviceRouteInfo, instance));
} else { } else {
log.error("拉取路由配置异常,url: {}, status: {}, body: {}", url, responseEntity.getStatusCodeValue(), responseEntity.getBody()); log.error("拉取路由配置异常,url: {}, status: {}, body: {}", url, responseEntity.getStatusCodeValue(), responseEntity.getBody());
} }
} }
private ServiceRouteInfo parseServiceRouteInfo(String body) {
ServiceRouteInfo serviceRouteInfo = JSON.parseObject(body, ServiceRouteInfo.class);
serviceRouteInfo.setServiceId(serviceRouteInfo.getServiceId().toLowerCase());
return serviceRouteInfo;
}
protected HttpEntity<String> getHttpEntity() { protected HttpEntity<String> getHttpEntity() {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
return new HttpEntity<>(headers); return new HttpEntity<>(headers);

@ -6,13 +6,13 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -4,13 +4,13 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>sdk-java</artifactId> <artifactId>sdk-java</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<properties> <properties>
<!-- Generic properties --> <!-- Generic properties -->

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId> <artifactId>sop-parent</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-website</artifactId> <artifactId>sop-website</artifactId>
<version>4.3.0-SNAPSHOT</version> <version>4.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository --> <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent> </parent>

Loading…
Cancel
Save