From 883a6afd0b3d0607d0ae4afe41065d22a10a8c37 Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 4 Jan 2021 14:42:41 +0800 Subject: [PATCH 1/7] 4.2.4 --- doc/docs/files/10110_预发布灰度发布.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/docs/files/10110_预发布灰度发布.md b/doc/docs/files/10110_预发布灰度发布.md index 6b469196..4d5a0cb3 100644 --- a/doc/docs/files/10110_预发布灰度发布.md +++ b/doc/docs/files/10110_预发布灰度发布.md @@ -40,6 +40,14 @@ pre.domain=openpre.domain.com ## 使用灰度发布 +- 灰度接口定义 + +接口名相同,版本号不同。比如接口`user.get`,version:1.0 + +新建一个接口`user.get`,version:2.0 + +那么这个2.0接口就是灰度接口 + 灰度发布可允许指定的用户访问灰度服务器,其它用户还是走正常流程。 登录SOP-Admin,前往`服务列表`。 From b053c7b4e513478c96229ec09f1e3e73867b4b29 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 26 Jan 2021 14:58:08 +0800 Subject: [PATCH 2/7] 4.2.4 --- doc/docs/files/10087_自定义返回结果.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/doc/docs/files/10087_自定义返回结果.md b/doc/docs/files/10087_自定义返回结果.md index 8269c67e..e5609bea 100644 --- a/doc/docs/files/10087_自定义返回结果.md +++ b/doc/docs/files/10087_自定义返回结果.md @@ -44,7 +44,7 @@ return method.replace('.', '_') + "_response"; ```java @Configuration -public class ZuulConfig extends AlipayZuulConfiguration { +public class MyConfig { static { ... @@ -84,23 +84,18 @@ public class ZuulConfig extends AlipayZuulConfiguration { 如果想要对微服务结果做更深一步处理,步骤如下: -1. 新增一个类,继承`ZuulResultExecutor.java`,并重写`public String merge(T exchange, JSONObject responseData)`方法 - -方法merge参数说明如下: - - exchange:RequestContext对象 - responseData:微服务端返回的结果 - -方法返回最终结果 +1. 新增一个类,继承`GatewayResultExecutor.java`,并重写`String mergeResult(T request, String serviceResult)`方法 2. 配置自定义类 ```java -public class SopGatewayApplication { - - public static void main(String[] args) { - ApiConfig.getInstance().setZuulResultExecutor(new MyzuulResultExecutor()); - SpringApplication.run(SopGatewayApplication.class, args); +@Configuration +public class MyConfig { + + static { + ... + ApiConfig.getInstance().setGatewayResultExecutor(new MyGatewayResultExecutor()); + ... } } From a3d97a4f8cf99b1c8c013d584f74946a525cbba8 Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 27 Jan 2021 11:18:57 +0800 Subject: [PATCH 3/7] 4.2.4 --- .../sop/gatewaycommon/interceptor/RouteInterceptorContext.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/interceptor/RouteInterceptorContext.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/interceptor/RouteInterceptorContext.java index 6e1d9dcf..fbb3d307 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/interceptor/RouteInterceptorContext.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/interceptor/RouteInterceptorContext.java @@ -1,6 +1,5 @@ package com.gitee.sop.gatewaycommon.interceptor; -import com.gitee.sop.gatewaycommon.bean.SopConstants; import com.gitee.sop.gatewaycommon.param.ApiParam; import org.springframework.cloud.client.ServiceInstance; import org.springframework.http.HttpStatus; From 8d071e2ac39adb27d2473831d10f9525cf55aecd Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 1 Feb 2021 16:10:46 +0800 Subject: [PATCH 4/7] 4.2.4 --- doc/docs/files/10020_新增接口.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/docs/files/10020_新增接口.md b/doc/docs/files/10020_新增接口.md index 692608f5..bd31cc62 100644 --- a/doc/docs/files/10020_新增接口.md +++ b/doc/docs/files/10020_新增接口.md @@ -44,6 +44,8 @@ public StoryResult getStory() { 其中biz_content部分是我们想要的,在方法上申明一个对象,对应biz_content中的内容即可完成参数绑定,并且对参数进行JSR-303校验。 +**注意:接口方法必须有且只有一个对象参数,如果申明多个会出现参数绑定失败** + ```java @Open("goods.add") @RequestMapping("/goods/add") From d642a4f9c6762bb23ba21216f0fb1cde1c070f01 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 2 Feb 2021 14:00:50 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drestful=E8=B4=9F=E8=BD=BD?= =?UTF-8?q?=E5=9D=87=E8=A1=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sop-common/sop-gateway-common/pom.xml | 5 ++ .../sop/gatewaycommon/bean/ApiConfig.java | 4 +- .../AlipayGatewayConfiguration.java | 6 --- .../gateway/controller/RestfulController.java | 50 +++++++++++++++++++ .../gateway/filter/IndexFilter.java | 6 +-- .../Example1008_RestfulController.java | 6 ++- .../main/resources/application-dev.properties | 5 +- 7 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml index 6fcdfb39..838b39bc 100644 --- a/sop-common/sop-gateway-common/pom.xml +++ b/sop-common/sop-gateway-common/pom.xml @@ -54,6 +54,11 @@ fastjson + + org.springframework.cloud + spring-cloud-gateway-webflux + + com.alibaba.cloud diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java index 4607b73b..93659911 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java @@ -28,12 +28,12 @@ import com.gitee.sop.gatewaycommon.result.ResultExecutorForGateway; import com.gitee.sop.gatewaycommon.secret.CacheIsvManager; import com.gitee.sop.gatewaycommon.secret.IsvManager; import com.gitee.sop.gatewaycommon.validate.ApiEncrypter; -import com.gitee.sop.gatewaycommon.validate.ApiSigner; import com.gitee.sop.gatewaycommon.validate.ApiValidator; import com.gitee.sop.gatewaycommon.validate.Encrypter; import com.gitee.sop.gatewaycommon.validate.Signer; import com.gitee.sop.gatewaycommon.validate.TokenValidator; import com.gitee.sop.gatewaycommon.validate.Validator; +import com.gitee.sop.gatewaycommon.validate.alipay.AlipaySigner; import lombok.Data; import org.apache.commons.lang3.StringUtils; @@ -74,7 +74,7 @@ public class ApiConfig { /** * 签名工具 */ - private Signer signer = new ApiSigner(); + private Signer signer = new AlipaySigner(); /** * 验证 diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/AlipayGatewayConfiguration.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/AlipayGatewayConfiguration.java index b84b6670..33ceeef3 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/AlipayGatewayConfiguration.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/AlipayGatewayConfiguration.java @@ -1,8 +1,5 @@ package com.gitee.sop.gatewaycommon.gateway.configuration; -import com.gitee.sop.gatewaycommon.bean.ApiContext; -import com.gitee.sop.gatewaycommon.validate.alipay.AlipaySigner; - /** * 具备支付宝开放平台能力配置 https://docs.open.alipay.com/api * @@ -10,7 +7,4 @@ import com.gitee.sop.gatewaycommon.validate.alipay.AlipaySigner; */ public class AlipayGatewayConfiguration extends BaseGatewayConfiguration { - static { - ApiContext.getApiConfig().setSigner(new AlipaySigner()); - } } diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java new file mode 100644 index 00000000..84440aac --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java @@ -0,0 +1,50 @@ +package com.gitee.sop.gatewaycommon.gateway.controller; + +import com.gitee.sop.gatewaycommon.bean.SpringContext; +import com.gitee.sop.gatewaycommon.gateway.loadbalancer.SopLoadBalancerClient; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.gateway.webflux.ProxyExchange; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +/** + * 处理restful请求 + * @author tanghc + */ +@Controller +public class RestfulController { + + private static final int PREFIX_LEN = "/rest/".length(); + + @RequestMapping("/rest/**") + public Mono> proxy(ProxyExchange proxy, ServerWebExchange exchange) { + String path = proxy.path(); + String serviceId = getServiceId(path); + String targetPath = getTargetPath(serviceId, path); + String rawQuery = exchange.getRequest().getURI().getRawQuery(); + if (StringUtils.hasLength(rawQuery)) { + targetPath = targetPath + "?" + rawQuery; + } + // 负载均衡 + ServiceInstance serviceInstance = SpringContext.getBean(SopLoadBalancerClient.class).choose(serviceId, exchange); + String uri = "http://" + serviceInstance.getHost() + ":" + serviceInstance.getPort() + targetPath; + return proxy.uri(uri).forward(); + } + + private String getServiceId(String path) { + // /rest/story-service/food/getFoodById + path = path.substring(PREFIX_LEN); + int index = path.indexOf('/'); + path = path.substring(0, index); + return path; + } + + private String getTargetPath(String serviceId, String path) { + int len = PREFIX_LEN + serviceId.length(); + return path.substring(len); + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/IndexFilter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/IndexFilter.java index 236752cc..583966a7 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/IndexFilter.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/IndexFilter.java @@ -72,11 +72,9 @@ public class IndexFilter implements WebFilter { return chain.filter(exchange); } // 如果是restful请求,直接转发 + // see:com.gitee.sop.gatewaycommon.gateway.controller.RestfulController if (enableRestful && path.startsWith(EnvironmentKeys.SOP_RESTFUL_PATH.getValue())) { - exchange.getAttributes().put(SopConstants.RESTFUL_REQUEST, true); - String restfulPath = ServerWebExchangeUtil.getRestfulPath(path, EnvironmentKeys.SOP_RESTFUL_PATH.getValue()); - ServerWebExchange newExchange = ServerWebExchangeUtil.getForwardExchange(exchange, restfulPath); - return chain.filter(newExchange); + return chain.filter(exchange); } if (Objects.equals(path, indexPath)) { if (request.getMethod() == HttpMethod.POST) { diff --git a/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1008_RestfulController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1008_RestfulController.java index 36de18b0..2c7af9e7 100644 --- a/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1008_RestfulController.java +++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1008_RestfulController.java @@ -4,6 +4,8 @@ import com.gitee.sop.servercommon.util.UploadUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,6 +27,8 @@ import java.util.Collection; @Api(tags = "食物接口") public class Example1008_RestfulController { + @Autowired + private Environment environment; // http://localhost:8081/rest/story-service/food/getFoodById?id=1 网关入口 // http://localhost:2222/food/getFoodById/?id=12 本地入口 @@ -33,7 +37,7 @@ public class Example1008_RestfulController { public Food getFoodById(Integer id) { Food food = new Food(); food.setId(id); - food.setName("香蕉"); + food.setName("香蕉, " + environment.getProperty("server.port")); food.setPrice(new BigDecimal(20.00)); return food; } diff --git a/sop-example/sop-story/src/main/resources/application-dev.properties b/sop-example/sop-story/src/main/resources/application-dev.properties index 5ce2d493..b54bc292 100644 --- a/sop-example/sop-story/src/main/resources/application-dev.properties +++ b/sop-example/sop-story/src/main/resources/application-dev.properties @@ -1,6 +1,9 @@ server.port=2222 spring.application.name=story-service register.url=127.0.0.1:8848 -# 注册中心 +# \u6CE8\u518C\u4E2D\u5FC3 spring.cloud.nacos.discovery.server-addr=${register.url} +# \u4E0A\u4F20\u6587\u4EF6\u6700\u5927\u503C +spring.servlet.multipart.max-file-size=20MB +spring.servlet.multipart.max-request-size=20MB \ No newline at end of file From e09f332fe6611327843b543d6e287a9fa99c3da3 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 2 Feb 2021 14:03:01 +0800 Subject: [PATCH 6/7] 4.2.5 --- changelog.md | 4 ++++ doc/pom.xml | 2 +- pom.xml | 2 +- sop-admin/pom.xml | 4 ++-- sop-admin/sop-admin-server/pom.xml | 4 ++-- sop-auth/pom.xml | 6 +++--- sop-common/pom.xml | 2 +- sop-common/sop-bridge-eureka/pom.xml | 6 +++--- sop-common/sop-bridge-nacos/pom.xml | 6 +++--- sop-common/sop-gateway-common/pom.xml | 4 ++-- sop-common/sop-service-common/pom.xml | 4 ++-- sop-example/pom.xml | 2 +- sop-example/sop-springmvc/pom.xml | 4 ++-- sop-example/sop-story/pom.xml | 4 ++-- sop-gateway/pom.xml | 4 ++-- sop-sdk/pom.xml | 4 ++-- sop-sdk/sdk-java/pom.xml | 4 ++-- sop-test/pom.xml | 2 +- sop-website/pom.xml | 4 ++-- sop-website/sop-website-server/pom.xml | 4 ++-- 20 files changed, 40 insertions(+), 36 deletions(-) diff --git a/changelog.md b/changelog.md index 9965dbac..e44fb401 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # changelog +## 4.2.5 + +- 修复restful负载均衡问题 + ## 4.2.4 - 修复sop-auth模块启动失败问题 diff --git a/doc/pom.xml b/doc/pom.xml index 16d2abba..3f273928 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.gitee.sop doc - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index f554358b..c507b1ff 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ 4.0.0 com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT pom 一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台 diff --git a/sop-admin/pom.xml b/sop-admin/pom.xml index 601957cf..390c6d7d 100644 --- a/sop-admin/pom.xml +++ b/sop-admin/pom.xml @@ -6,13 +6,13 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml 4.0.0 sop-admin - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT pom diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index 8f569086..575a8a77 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.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 sop-admin-server - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT jar diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml index 30ae33bd..3efbe934 100644 --- a/sop-auth/pom.xml +++ b/sop-auth/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml @@ -25,7 +25,7 @@ com.gitee.sop sop-service-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT @@ -38,7 +38,7 @@ com.gitee.sop sdk-java - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-common/pom.xml b/sop-common/pom.xml index 220a4744..185b01de 100644 --- a/sop-common/pom.xml +++ b/sop-common/pom.xml @@ -6,7 +6,7 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml diff --git a/sop-common/sop-bridge-eureka/pom.xml b/sop-common/sop-bridge-eureka/pom.xml index 80e8fe15..1378df0d 100644 --- a/sop-common/sop-bridge-eureka/pom.xml +++ b/sop-common/sop-bridge-eureka/pom.xml @@ -5,12 +5,12 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT sop-bridge-eureka @@ -18,7 +18,7 @@ com.gitee.sop sop-gateway-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-common/sop-bridge-nacos/pom.xml b/sop-common/sop-bridge-nacos/pom.xml index 66670910..60a5e3d9 100644 --- a/sop-common/sop-bridge-nacos/pom.xml +++ b/sop-common/sop-bridge-nacos/pom.xml @@ -5,12 +5,12 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT sop-bridge-nacos @@ -18,7 +18,7 @@ com.gitee.sop sop-gateway-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml index 838b39bc..005dfab8 100644 --- a/sop-common/sop-gateway-common/pom.xml +++ b/sop-common/sop-gateway-common/pom.xml @@ -5,13 +5,13 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 sop-gateway-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT jar diff --git a/sop-common/sop-service-common/pom.xml b/sop-common/sop-service-common/pom.xml index 32701027..60f1dc07 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-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 sop-service-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT jar diff --git a/sop-example/pom.xml b/sop-example/pom.xml index d4844a40..0c11d667 100644 --- a/sop-example/pom.xml +++ b/sop-example/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml index 8470b409..5e07ef3f 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.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml @@ -26,7 +26,7 @@ com.gitee.sop sop-service-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml index 133e95d8..d4310bff 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.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml @@ -19,7 +19,7 @@ com.gitee.sop sop-service-common - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-gateway/pom.xml b/sop-gateway/pom.xml index cb530289..3c1d31cc 100644 --- a/sop-gateway/pom.xml +++ b/sop-gateway/pom.xml @@ -4,7 +4,7 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml @@ -24,7 +24,7 @@ com.gitee.sop sop-bridge-nacos - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-sdk/pom.xml b/sop-sdk/pom.xml index d3d9e571..fa2f495c 100644 --- a/sop-sdk/pom.xml +++ b/sop-sdk/pom.xml @@ -6,13 +6,13 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml 4.0.0 sop-sdk - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT pom diff --git a/sop-sdk/sdk-java/pom.xml b/sop-sdk/sdk-java/pom.xml index 0e80fd9a..4e3d28ad 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.4-SNAPSHOT + 4.2.5-SNAPSHOT ../../pom.xml 4.0.0 sdk-java - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT diff --git a/sop-test/pom.xml b/sop-test/pom.xml index 35877fc3..9c11677a 100644 --- a/sop-test/pom.xml +++ b/sop-test/pom.xml @@ -5,7 +5,7 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml diff --git a/sop-website/pom.xml b/sop-website/pom.xml index 95bc5857..d90b17ee 100644 --- a/sop-website/pom.xml +++ b/sop-website/pom.xml @@ -6,13 +6,13 @@ com.gitee.sop sop-parent - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml 4.0.0 sop-website - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT pom diff --git a/sop-website/sop-website-server/pom.xml b/sop-website/sop-website-server/pom.xml index 41a4b05a..0a2c0f13 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.4-SNAPSHOT + 4.2.5-SNAPSHOT ../pom.xml @@ -25,7 +25,7 @@ com.gitee.sop sop-bridge-nacos - 4.2.4-SNAPSHOT + 4.2.5-SNAPSHOT From 8efd1fc7b49fc448a8762aded9bba94de1149298 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 2 Feb 2021 14:08:56 +0800 Subject: [PATCH 7/7] 4.2.5 --- .../gatewaycommon/gateway/controller/RestfulController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java index 84440aac..dcad45ad 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java @@ -35,8 +35,12 @@ public class RestfulController { return proxy.uri(uri).forward(); } + /** + * 从path中解析出serviceId + * @param path 格式:/rest/ + * @return 返回serviceId + */ private String getServiceId(String path) { - // /rest/story-service/food/getFoodById path = path.substring(PREFIX_LEN); int index = path.indexOf('/'); path = path.substring(0, index);