From 45eae0c99ff89d99eecac4d463ab8c8eecb1d3bb Mon Sep 17 00:00:00 2001 From: tanghc Date: Thu, 11 Jun 2020 19:01:45 +0800 Subject: [PATCH 01/10] 3.2.0 --- changelog.md | 6 + sop-admin/sop-admin-server/pom.xml | 61 ++++-- .../SopAdminServerApplication.java | 2 + .../src/main/resources/public/index.html | 2 +- .../static/js/chunk-9f479afe.4609bf8b.js | 1 + .../static/js/chunk-9f479afe.51cf2439.js | 1 - .../src/views/service/serviceList.vue | 3 +- sop-auth/pom.xml | 70 ++++--- sop-common/pom.xml | 151 +++++++------- sop-common/sop-bridge-gateway/pom.xml | 6 +- sop-common/sop-bridge-zuul/pom.xml | 6 +- sop-common/sop-gateway-common/pom.xml | 42 ++-- .../gatewaycommon/bean/RouteDefinition.java | 3 + .../GatewayModifyResponseGatewayFilter.java | 2 +- .../gateway/filter/IndexFilter.java | 2 +- .../loadbalancer/NacosServerIntrospector.java | 2 +- .../gateway/route/GatewayRouteRepository.java | 6 +- .../manager/NacosEventProcessor.java | 119 ----------- .../manager/ServiceRoutesLoader.java | 183 ----------------- .../route/BaseRegistryListener.java | 1 + .../route/EurekaRegistryListener.java | 9 +- .../route/NacosRegistryListener.java | 113 ++++++++--- .../gatewaycommon/route/ServiceHolder.java | 11 ++ sop-common/sop-service-common/pom.xml | 25 ++- .../manager/RedisApiMetaManager.java | 30 --- sop-example/pom.xml | 2 - sop-example/readme.md | 4 +- sop-example/sop-book/pom.xml | 15 -- sop-example/sop-book/sop-book-api/.gitignore | 25 --- sop-example/sop-book/sop-book-api/pom.xml | 46 ----- .../java/com/gitee/book/api/domain/Book.java | 12 -- .../gitee/book/api/service/BookService.java | 14 -- sop-example/sop-book/sop-book-web/.gitignore | 25 --- sop-example/sop-book/sop-book-web/pom.xml | 147 -------------- .../gitee/sop/bookweb/SopBookApplication.java | 20 -- .../sop/bookweb/config/OpenServiceConfig.java | 33 ---- .../consumer/StoryServiceConsumer.java | 14 -- .../controller/AlipayBookController.java | 55 ------ .../sop/bookweb/controller/ApiResult.java | 72 ------- .../bookweb/controller/BookController.java | 73 ------- .../controller/DubboConsumerController.java | 40 ---- .../gitee/sop/bookweb/param/BookParam.java | 16 -- .../java/com/gitee/sop/bookweb/vo/BookVO.java | 16 -- .../main/resources/application-dev.properties | 16 -- .../sop/bookweb/SopBookApplicationTests.java | 17 -- sop-example/sop-easyopen/.gitignore | 25 --- sop-example/sop-easyopen/pom.xml | 126 ------------ sop-example/sop-easyopen/readme.md | 31 --- .../easyopen/server/IndexController.java | 25 --- .../server/SopEasyopenApplication.java | 14 -- .../gitee/easyopen/server/api/Goods2Api.java | 31 --- .../gitee/easyopen/server/api/GoodsApi.java | 31 --- .../easyopen/server/api/param/GoodsParam.java | 23 --- .../easyopen/server/api/result/Goods.java | 46 ----- .../easyopen/server/config/CorsConfig.java | 37 ---- .../easyopen/server/config/SopConfig.java | 28 --- .../server/interceptor/LogInterceptor.java | 23 --- .../easyopen/server/message/CommonErrors.java | 16 -- .../main/resources/application-dev.properties | 7 - .../src/main/resources/application.properties | 1 - .../resources/i18n/isv/error_zh_CN.properties | 2 - ...opEasyopenApplicationApplicationTests.java | 16 -- sop-example/sop-springmvc/pom.xml | 2 +- sop-example/sop-story/pom.xml | 138 +++++++++++-- .../sop-story/sop-story-api/.gitignore | 25 --- sop-example/sop-story/sop-story-api/pom.xml | 46 ----- .../com/gitee/sop/story/api/domain/Story.java | 18 -- .../gitee/sop/story/api/param/DemoParam.java | 14 -- .../sop/story/api/result/DemoResult.java | 15 -- .../sop/story/api/service/DemoService.java | 17 -- .../sop/story/api/service/StoryService.java | 15 -- .../sop-story/sop-story-web/.gitignore | 25 --- sop-example/sop-story/sop-story-web/pom.xml | 140 ------------- .../storyweb/controller/StoryController.java | 23 --- .../controller/StoryDemoController.java | 21 -- .../storyweb/service/DefaultDemoService.java | 32 --- .../src/main/resources/application.properties | 1 - .../sop/storyweb/SopStoryApplication.java | 0 .../storyweb/config/OpenServiceConfig.java | 0 .../storyweb/controller/AlipayController.java | 12 -- .../controller/AlipayController2.java | 0 .../controller/DownloadController.java | 0 .../controller/FileUploadDemoController.java | 0 .../controller/JSR303DemoController.java | 0 .../controller/PermissionDemoController.java | 1 - .../controller/PostJsonController.java | 24 +-- .../ThrowExceptionDemoController.java | 0 .../storyweb/controller/TokenController.java | 0 .../TraditionalWebappController.java | 0 .../controller/param/CategoryParam.java | 0 .../controller/param/FileUploadParam.java | 0 .../controller/param/FileUploadParam2.java | 0 .../storyweb/controller/param/GoodsParam.java | 0 .../controller/param/GoodsUpdateParam.java | 0 .../storyweb/controller/param/StoryParam.java | 0 .../controller/result/CategoryResult.java | 0 .../controller/result/FileUploadResult.java | 0 .../controller/result/StoryResult.java | 0 .../controller/result/TreeResult.java | 0 .../sop/storyweb/message/GoodsErrorEnum.java | 0 .../sop/storyweb/message/StoryErrorEnum.java | 0 .../main/resources/application-dev.properties | 7 - .../src/main/resources/application.properties | 0 .../resources/i18n/isp/bizerror_en.properties | 0 .../i18n/isp/bizerror_zh_CN.properties | 0 .../i18n/isp/goods_error_en.properties | 0 .../i18n/isp/goods_error_zh_CN.properties | 0 .../storyweb/SopStoryApplicationTests.java | 0 sop-gateway/pom.xml | 87 ++++---- .../gitee/sop/test/AlipayClientPostTest.java | 108 ---------- .../java/com/gitee/sop/test/AllInOneTest.java | 27 --- .../com/gitee/sop/test/DubboDemoTest.java | 58 ------ .../sop/test/EasyopenClientPostTest.java | 92 --------- .../java/com/gitee/sop/test/PostFormTest.java | 56 ------ .../java/com/gitee/sop/test/PostJsonTest.java | 90 --------- .../java/com/gitee/sop/test/RestUrlTest.java | 61 ------ .../SpringCloudGatewayClientPostTest.java | 185 ------------------ .../com/gitee/sop/test/StoryDemoTest.java | 87 -------- .../gitee/sop/test/TaobaoClientPostTest.java | 68 ------- sop-website/pom.xml | 32 ++- 120 files changed, 536 insertions(+), 2992 deletions(-) create mode 100644 sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js delete mode 100644 sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.51cf2439.js delete mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/NacosEventProcessor.java delete mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/ServiceRoutesLoader.java create mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/ServiceHolder.java delete mode 100644 sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/RedisApiMetaManager.java delete mode 100644 sop-example/sop-book/pom.xml delete mode 100644 sop-example/sop-book/sop-book-api/.gitignore delete mode 100644 sop-example/sop-book/sop-book-api/pom.xml delete mode 100644 sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java delete mode 100644 sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java delete mode 100644 sop-example/sop-book/sop-book-web/.gitignore delete mode 100644 sop-example/sop-book/sop-book-web/pom.xml delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/DubboConsumerController.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java delete mode 100644 sop-example/sop-book/sop-book-web/src/main/resources/application-dev.properties delete mode 100644 sop-example/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java delete mode 100644 sop-example/sop-easyopen/.gitignore delete mode 100644 sop-example/sop-easyopen/pom.xml delete mode 100644 sop-example/sop-easyopen/readme.md delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/IndexController.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/SopEasyopenApplication.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/Goods2Api.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/GoodsApi.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/param/GoodsParam.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/result/Goods.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/CorsConfig.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/SopConfig.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/interceptor/LogInterceptor.java delete mode 100644 sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/message/CommonErrors.java delete mode 100644 sop-example/sop-easyopen/src/main/resources/application-dev.properties delete mode 100644 sop-example/sop-easyopen/src/main/resources/application.properties delete mode 100644 sop-example/sop-easyopen/src/main/resources/i18n/isv/error_zh_CN.properties delete mode 100644 sop-example/sop-easyopen/src/test/java/com/gitee/sop/adminserver/SopEasyopenApplicationApplicationTests.java delete mode 100644 sop-example/sop-story/sop-story-api/.gitignore delete mode 100644 sop-example/sop-story/sop-story-api/pom.xml delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/param/DemoParam.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/result/DemoResult.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/DemoService.java delete mode 100644 sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java delete mode 100644 sop-example/sop-story/sop-story-web/.gitignore delete mode 100644 sop-example/sop-story/sop-story-web/pom.xml delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryController.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryDemoController.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/service/DefaultDemoService.java delete mode 100644 sop-example/sop-story/sop-story-web/src/main/resources/application.properties rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java (95%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java (94%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java (63%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/ThrowExceptionDemoController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/TokenController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/TraditionalWebappController.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/CategoryParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/FileUploadParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/FileUploadParam2.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/GoodsParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/GoodsUpdateParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/param/StoryParam.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/CategoryResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/FileUploadResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/StoryResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/controller/result/TreeResult.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/message/GoodsErrorEnum.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/java/com/gitee/sop/storyweb/message/StoryErrorEnum.java (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/application-dev.properties (80%) rename sop-example/{sop-book/sop-book-web => sop-story}/src/main/resources/application.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/bizerror_en.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/bizerror_zh_CN.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/goods_error_en.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/main/resources/i18n/isp/goods_error_zh_CN.properties (100%) rename sop-example/sop-story/{sop-story-web => }/src/test/java/com/gitee/sop/storyweb/SopStoryApplicationTests.java (100%) delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/DubboDemoTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/EasyopenClientPostTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/PostFormTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/PostJsonTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/RestUrlTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/SpringCloudGatewayClientPostTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/StoryDemoTest.java delete mode 100644 sop-test/src/test/java/com/gitee/sop/test/TaobaoClientPostTest.java diff --git a/changelog.md b/changelog.md index ebe0cbb8..19f075e6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # changelog +## 3.2.0 + +- 使用alibaba cloud + +Hoxton.SR3(Spring Cloud Version), 2.2.1.RELEASE(Spring Cloud Alibaba Version), 2.2.5.RELEASE(Spring Boot Version) + ## 3.1.5 修复文件上传大小不一致问题 diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index bcd2e93e..32f4ac06 100644 --- a/sop-admin/sop-admin-server/pom.xml +++ b/sop-admin/sop-admin-server/pom.xml @@ -2,6 +2,12 @@ 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.5.RELEASE + + com.gitee.sop sop-admin-server 1.0.0-SNAPSHOT @@ -10,32 +16,51 @@ sop-admin-server sop-admin-server - - org.springframework.boot - spring-boot-starter-parent - 2.1.4.RELEASE - - - + 1.8 UTF-8 UTF-8 - 1.8 3.11.0 - - 0.2.3 + + 2.2.5.RELEASE + + Hoxton.SR3 + + + 2.2.1.RELEASE + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + - com.alibaba.boot - nacos-config-spring-boot-starter - ${nacos-spring-boot-starter.version} - - - com.alibaba.boot - nacos-discovery-spring-boot-starter - ${nacos-spring-boot-starter.version} + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java index e388660d..52bf77ac 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/SopAdminServerApplication.java @@ -2,7 +2,9 @@ package com.gitee.sop.adminserver; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +@EnableDiscoveryClient @SpringBootApplication public class SopAdminServerApplication { diff --git a/sop-admin/sop-admin-server/src/main/resources/public/index.html b/sop-admin/sop-admin-server/src/main/resources/public/index.html index 69e80a53..9375a706 100644 --- a/sop-admin/sop-admin-server/src/main/resources/public/index.html +++ b/sop-admin/sop-admin-server/src/main/resources/public/index.html @@ -1 +1 @@ -SOP Admin
\ No newline at end of file +SOP Admin
\ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js new file mode 100644 index 00000000..eb8f7b8d --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.4609bf8b.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9f479afe"],{"02f4":function(e,t,n){var r=n("4588"),o=n("be13");e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),c=s("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),v=!i(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=v?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!t}):void 0;if(!v||!p||"replace"===e&&!u||"split"===e&&!f){var g=/./[d],y=n(a,d,""[e],function(e,t,n,r,o){return t.exec===l?v&&!o?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),h=y[0],m=y[1];r(String.prototype,e,h),o(RegExp.prototype,d,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})}}},"28a5":function(e,t,n){"use strict";var r=n("aae3"),o=n("cb7c"),i=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),c=n("520a"),u=n("79e5"),f=Math.min,d=[].push,v="split",p="length",g="lastIndex",y=4294967295,h=!u(function(){RegExp(y,"y")});n("214f")("split",2,function(e,t,n,u){var m;return m="c"=="abbc"[v](/(b)*/)[1]||4!="test"[v](/(?:)/,-1)[p]||2!="ab"[v](/(?:ab)*/)[p]||4!="."[v](/(.?)(.?)/)[p]||"."[v](/()()/)[p]>1||""[v](/.?/)[p]?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=void 0===t?y:t>>>0,h=new RegExp(e.source,u+"g");while(i=c.call(h,o)){if(a=h[g],a>f&&(l.push(o.slice(f,i.index)),i[p]>1&&i.index=v))break;h[g]===i.index&&h[g]++}return f===o[p]?!s&&h.test("")||l.push(""):l.push(o.slice(f)),l[p]>v?l.slice(0,v):l}:"0"[v](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=u(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),d=String(this),v=i(c,RegExp),p=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),b=new v(h?c:"^(?:"+c.source+")",g),_=void 0===t?y:t>>>0;if(0===_)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,x=0,I=[];while(x1&&i.call(a[0],n,function(){for(u=1;u0&&"pre"===t.row.metadata.env?n("el-tag",{attrs:{type:"warning"}},[e._v("预发布")]):e._e(),e._v(" "),t.row.parentId>0&&"gray"===t.row.metadata.env?n("el-tag",{attrs:{type:"info"}},[e._v("灰度")]):e._e(),e._v(" "),t.row.parentId>0&&!t.row.metadata.env?n("el-tag",{attrs:{type:"success"}},[e._v("线上")]):e._e()],1):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"metadata",label:"metadata",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0?n("span",[e._v(e._s(JSON.stringify(t.row.metadata)))]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"服务状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0&&"UP"===t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):e._e(),e._v(" "),t.row.parentId>0&&"STARTING"===t.row.status?n("el-tag",{attrs:{type:"info"}},[e._v("正在启动")]):e._e(),e._v(" "),t.row.parentId>0&&"UNKNOWN"===t.row.status?n("el-tag",[e._v("未知")]):e._e(),e._v(" "),t.row.parentId>0&&("OUT_OF_SERVICE"===t.row.status||"DOWN"===t.row.status)?n("el-tag",{attrs:{type:"danger"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.blackList.indexOf(t.row.serviceId.toLowerCase())<0?n("div",[0===t.row.parentId?n("div",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onGrayConfigUpdate(t.row)}}},[e._v("设置灰度参数")])],1):e._e(),e._v(" "),t.row.parentId>0?n("div",["UP"===t.row.status?n("span",["pre"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreClose(t.row)}}},[e._v("结束预发布")]):e._e(),e._v(" "),"gray"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayClose(t.row)}}},[e._v("结束灰度")]):e._e(),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreOpen(t.row)}}},[e._v("开启预发布")]),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayOpen(t.row)}}},[e._v("开启灰度")])],1):e._e(),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},["UP"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onDisable(t.row)}}},[e._v("禁用")]):e._e(),e._v(" "),"OUT_OF_SERVICE"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnable(t.row)}}},[e._v("启用")]):e._e()],1)]):e._e()]):e._e()]}}])})],1),e._v(" "),n("el-dialog",{attrs:{title:"灰度设置",visible:e.grayDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.grayDialogVisible=t},close:function(t){return e.resetForm("grayForm")}}},[n("el-form",{ref:"grayForm",attrs:{model:e.grayForm,rules:e.grayFormRules,size:"mini"}},[n("el-form-item",{attrs:{label:"serviceId"}},[e._v("\n "+e._s(e.grayForm.serviceId)+"\n ")]),e._v(" "),n("el-tabs",{attrs:{type:"card"},model:{value:e.tabsActiveName,callback:function(t){e.tabsActiveName=t},expression:"tabsActiveName"}},[n("el-tab-pane",{attrs:{label:"灰度用户",name:"first"}},[n("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"可以是appId或IP地址,多个用英文逗号隔开",type:"info",closable:!1}}),e._v(" "),n("el-form-item",{attrs:{prop:"userKeyContent"}},[n("el-input",{attrs:{placeholder:"可以是appId或IP地址,多个用英文逗号隔开",type:"textarea",rows:6},model:{value:e.grayForm.userKeyContent,callback:function(t){e.$set(e.grayForm,"userKeyContent",t)},expression:"grayForm.userKeyContent"}})],1)],1),e._v(" "),n("el-tab-pane",{attrs:{label:"接口配置",name:"second"}},[n("el-form-item",[n("el-button",{attrs:{type:"text"},on:{click:e.addNameVersion}},[e._v("新增灰度接口")])],1),e._v(" "),n("table",{attrs:{cellpadding:"0",cellspacing:"0"}},e._l(e.grayForm.grayRouteConfigList,function(t,r){return n("tr",{key:t.key},[n("td",[n("el-form-item",{key:t.key,attrs:{prop:"grayRouteConfigList."+r+".oldRouteId",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 老接口:\n "),n("el-select",{staticStyle:{"margin-right":"10px"},on:{change:function(n){return e.onChangeOldRoute(t)}},model:{value:t.oldRouteId,callback:function(n){e.$set(t,"oldRouteId",n)},expression:"grayRouteConfig.oldRouteId"}},e._l(e.routeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.id}})}),1)],1)],1),e._v(" "),n("td",[n("el-form-item",{key:t.key+1,attrs:{prop:"grayRouteConfigList."+r+".newVersion",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 灰度接口:\n "),n("el-select",{attrs:{"no-data-text":"无数据"},model:{value:t.newVersion,callback:function(n){e.$set(t,"newVersion",n)},expression:"grayRouteConfig.newVersion"}},e._l(e.getGraySelectData(t.oldRouteId),function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.version}})}),1)],1)],1),e._v(" "),n("td",{staticStyle:{"vertical-align":"baseline"}},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.grayForm.grayRouteConfigList.length>1,expression:"grayForm.grayRouteConfigList.length > 1"}],attrs:{type:"text"},on:{click:function(n){return n.preventDefault(),e.removeNameVersion(t)}}},[e._v("删除")])],1)])}),0)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.grayDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onGrayConfigSave}},[e._v("确 定")])],1)],1)],1)},o=[],i=(n("28a5"),n("ac6a"),n("7f7f"),{data:function(){var e=/^\S+(,\S+)*$/,t=function(t,n,r){""===n?r(new Error("不能为空")):(e.test(n)||r(new Error("格式不正确")),r())};return{searchFormData:{serviceId:""},blackList:["sop-gateway","sop-admin"],grayDialogVisible:!1,grayForm:{serviceId:"",userKeyContent:"",onlyUpdateGrayUserkey:!1,grayRouteConfigList:[]},tabsActiveName:"first",routeList:[],selectNameVersion:[],grayFormRules:{userKeyContent:[{required:!0,message:"不能为空",trigger:"blur"},{validator:t,trigger:"blur"}]},tableData:[]}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("service.instance.list",this.searchFormData,function(e){this.tableData=this.buildTreeData(e.data)})},loadRouteList:function(e){this.post("route.list/1.2",{serviceId:e.toLowerCase()},function(e){this.routeList=e.data})},getGraySelectData:function(e){return this.routeList.filter(function(t){return e!==t.id&&e.indexOf(t.name)>-1})},buildTreeData:function(e){return e.forEach(function(t){var n=t.parentId;0===n||e.forEach(function(e){if(e.id===n){var r=e.children;r||(r=[]),r.push(t),e.children=r}})}),e=e.filter(function(e){return 0===e.parentId}),e},onSearchTable:function(){this.loadTable()},onDisable:function(e){this.confirm("确定要禁用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.offline",e,function(){this.tip("禁用成功"),t(),this.loadTableDelay()})})},onEnable:function(e){this.confirm("确定要启用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.online",e,function(){this.tip("启用成功"),t(),this.loadTableDelay()})})},doEnvOnline:function(e,t){this.post("service.instance.env.online",e,function(){t&&t.call(this)})},onEnvPreOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.post("service.instance.env.pre.open",e,function(){this.tip("预发布成功"),t(),this.loadTableDelay()})})},onEnvPreClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onEnvGrayOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.post("service.instance.env.gray.open",e,function(){this.tip("开启成功"),t(),this.loadTableDelay()})})},onEnvGrayClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onGrayConfigUpdate:function(e){var t=e.serviceId;this.loadRouteList(t),this.post("service.gray.config.get",{serviceId:t},function(e){var n=this;this.grayDialogVisible=!0,this.$nextTick(function(){var r=e.data;Object.assign(n.grayForm,{serviceId:t,userKeyContent:r.userKeyContent||"",grayRouteConfigList:n.createGrayRouteConfigList(r.nameVersionContent)})})})},onGrayConfigSave:function(){var e=this;this.$refs.grayForm.validate(function(t){if(t){for(var n=[],r=e.grayForm.grayRouteConfigList,o=0;o=c?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),c=s("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),v=!i(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=v?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!t}):void 0;if(!v||!p||"replace"===e&&!u||"split"===e&&!f){var g=/./[d],y=n(a,d,""[e],function(e,t,n,r,o){return t.exec===l?v&&!o?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),h=y[0],m=y[1];r(String.prototype,e,h),o(RegExp.prototype,d,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})}}},"28a5":function(e,t,n){"use strict";var r=n("aae3"),o=n("cb7c"),i=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),c=n("520a"),u=n("79e5"),f=Math.min,d=[].push,v="split",p="length",g="lastIndex",y=4294967295,h=!u(function(){RegExp(y,"y")});n("214f")("split",2,function(e,t,n,u){var m;return m="c"=="abbc"[v](/(b)*/)[1]||4!="test"[v](/(?:)/,-1)[p]||2!="ab"[v](/(?:ab)*/)[p]||4!="."[v](/(.?)(.?)/)[p]||"."[v](/()()/)[p]>1||""[v](/.?/)[p]?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=void 0===t?y:t>>>0,h=new RegExp(e.source,u+"g");while(i=c.call(h,o)){if(a=h[g],a>f&&(l.push(o.slice(f,i.index)),i[p]>1&&i.index=v))break;h[g]===i.index&&h[g]++}return f===o[p]?!s&&h.test("")||l.push(""):l.push(o.slice(f)),l[p]>v?l.slice(0,v):l}:"0"[v](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=u(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),d=String(this),v=i(c,RegExp),p=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),b=new v(h?c:"^(?:"+c.source+")",g),_=void 0===t?y:t>>>0;if(0===_)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,x=0,I=[];while(x1&&i.call(a[0],n,function(){for(u=1;u0&&"pre"===t.row.metadata.env?n("el-tag",{attrs:{type:"warning"}},[e._v("预发布")]):e._e(),e._v(" "),t.row.parentId>0&&"gray"===t.row.metadata.env?n("el-tag",{attrs:{type:"info"}},[e._v("灰度")]):e._e(),e._v(" "),t.row.parentId>0&&!t.row.metadata.env?n("el-tag",{attrs:{type:"success"}},[e._v("线上")]):e._e()],1):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"metadata",label:"metadata",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0?n("span",[e._v(e._s(JSON.stringify(t.row.metadata)))]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"服务状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0&&"UP"===t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):e._e(),e._v(" "),t.row.parentId>0&&"STARTING"===t.row.status?n("el-tag",{attrs:{type:"info"}},[e._v("正在启动")]):e._e(),e._v(" "),t.row.parentId>0&&"UNKNOWN"===t.row.status?n("el-tag",[e._v("未知")]):e._e(),e._v(" "),t.row.parentId>0&&("OUT_OF_SERVICE"===t.row.status||"DOWN"===t.row.status)?n("el-tag",{attrs:{type:"danger"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return["sop-gateway"!==t.row.serviceId.toLowerCase()?n("div",[0===t.row.parentId?n("div",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onGrayConfigUpdate(t.row)}}},[e._v("设置灰度参数")])],1):e._e(),e._v(" "),t.row.parentId>0?n("div",["UP"===t.row.status?n("span",["pre"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreClose(t.row)}}},[e._v("结束预发布")]):e._e(),e._v(" "),"gray"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayClose(t.row)}}},[e._v("结束灰度")]):e._e(),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreOpen(t.row)}}},[e._v("开启预发布")]),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayOpen(t.row)}}},[e._v("开启灰度")])],1):e._e(),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},["UP"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onDisable(t.row)}}},[e._v("禁用")]):e._e(),e._v(" "),"OUT_OF_SERVICE"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnable(t.row)}}},[e._v("启用")]):e._e()],1)]):e._e()]):e._e()]}}])})],1),e._v(" "),n("el-dialog",{attrs:{title:"灰度设置",visible:e.grayDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.grayDialogVisible=t},close:function(t){return e.resetForm("grayForm")}}},[n("el-form",{ref:"grayForm",attrs:{model:e.grayForm,rules:e.grayFormRules,size:"mini"}},[n("el-form-item",{attrs:{label:"serviceId"}},[e._v("\n "+e._s(e.grayForm.serviceId)+"\n ")]),e._v(" "),n("el-tabs",{attrs:{type:"card"},model:{value:e.tabsActiveName,callback:function(t){e.tabsActiveName=t},expression:"tabsActiveName"}},[n("el-tab-pane",{attrs:{label:"灰度用户",name:"first"}},[n("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"可以是appId或IP地址,多个用英文逗号隔开",type:"info",closable:!1}}),e._v(" "),n("el-form-item",{attrs:{prop:"userKeyContent"}},[n("el-input",{attrs:{placeholder:"可以是appId或IP地址,多个用英文逗号隔开",type:"textarea",rows:6},model:{value:e.grayForm.userKeyContent,callback:function(t){e.$set(e.grayForm,"userKeyContent",t)},expression:"grayForm.userKeyContent"}})],1)],1),e._v(" "),n("el-tab-pane",{attrs:{label:"接口配置",name:"second"}},[n("el-form-item",[n("el-button",{attrs:{type:"text"},on:{click:e.addNameVersion}},[e._v("新增灰度接口")])],1),e._v(" "),n("table",{attrs:{cellpadding:"0",cellspacing:"0"}},e._l(e.grayForm.grayRouteConfigList,function(t,r){return n("tr",{key:t.key},[n("td",[n("el-form-item",{key:t.key,attrs:{prop:"grayRouteConfigList."+r+".oldRouteId",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 老接口:\n "),n("el-select",{staticStyle:{"margin-right":"10px"},on:{change:function(n){return e.onChangeOldRoute(t)}},model:{value:t.oldRouteId,callback:function(n){e.$set(t,"oldRouteId",n)},expression:"grayRouteConfig.oldRouteId"}},e._l(e.routeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.id}})}),1)],1)],1),e._v(" "),n("td",[n("el-form-item",{key:t.key+1,attrs:{prop:"grayRouteConfigList."+r+".newVersion",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 灰度接口:\n "),n("el-select",{attrs:{"no-data-text":"无数据"},model:{value:t.newVersion,callback:function(n){e.$set(t,"newVersion",n)},expression:"grayRouteConfig.newVersion"}},e._l(e.getGraySelectData(t.oldRouteId),function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.version}})}),1)],1)],1),e._v(" "),n("td",{staticStyle:{"vertical-align":"baseline"}},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.grayForm.grayRouteConfigList.length>1,expression:"grayForm.grayRouteConfigList.length > 1"}],attrs:{type:"text"},on:{click:function(n){return n.preventDefault(),e.removeNameVersion(t)}}},[e._v("删除")])],1)])}),0)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.grayDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onGrayConfigSave}},[e._v("确 定")])],1)],1)],1)},o=[],i=(n("28a5"),n("ac6a"),n("7f7f"),{data:function(){var e=/^\S+(,\S+)*$/,t=function(t,n,r){""===n?r(new Error("不能为空")):(e.test(n)||r(new Error("格式不正确")),r())};return{searchFormData:{serviceId:""},grayDialogVisible:!1,grayForm:{serviceId:"",userKeyContent:"",onlyUpdateGrayUserkey:!1,grayRouteConfigList:[]},tabsActiveName:"first",routeList:[],selectNameVersion:[],grayFormRules:{userKeyContent:[{required:!0,message:"不能为空",trigger:"blur"},{validator:t,trigger:"blur"}]},tableData:[]}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("service.instance.list",this.searchFormData,function(e){this.tableData=this.buildTreeData(e.data)})},loadRouteList:function(e){this.post("route.list/1.2",{serviceId:e.toLowerCase()},function(e){this.routeList=e.data})},getGraySelectData:function(e){return this.routeList.filter(function(t){return e!==t.id&&e.indexOf(t.name)>-1})},buildTreeData:function(e){return e.forEach(function(t){var n=t.parentId;0===n||e.forEach(function(e){if(e.id===n){var r=e.children;r||(r=[]),r.push(t),e.children=r}})}),e=e.filter(function(e){return 0===e.parentId}),e},onSearchTable:function(){this.loadTable()},onDisable:function(e){this.confirm("确定要禁用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.offline",e,function(){this.tip("禁用成功"),t(),this.loadTableDelay()})})},onEnable:function(e){this.confirm("确定要启用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.online",e,function(){this.tip("启用成功"),t(),this.loadTableDelay()})})},doEnvOnline:function(e,t){this.post("service.instance.env.online",e,function(){t&&t.call(this)})},onEnvPreOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.post("service.instance.env.pre.open",e,function(){this.tip("预发布成功"),t(),this.loadTableDelay()})})},onEnvPreClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onEnvGrayOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.post("service.instance.env.gray.open",e,function(){this.tip("开启成功"),t(),this.loadTableDelay()})})},onEnvGrayClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onGrayConfigUpdate:function(e){var t=e.serviceId;this.loadRouteList(t),this.post("service.gray.config.get",{serviceId:t},function(e){var n=this;this.grayDialogVisible=!0,this.$nextTick(function(){var r=e.data;Object.assign(n.grayForm,{serviceId:t,userKeyContent:r.userKeyContent||"",grayRouteConfigList:n.createGrayRouteConfigList(r.nameVersionContent)})})})},onGrayConfigSave:function(){var e=this;this.$refs.grayForm.validate(function(t){if(t){for(var n=[],r=e.grayForm.grayRouteConfigList,o=0;o From 0fb884c4510dc7b423c20fb4946a67ea484ca6f1 Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 12 Jun 2020 08:38:28 +0800 Subject: [PATCH 03/10] 3.2.0 --- .../adminserver/service/ServerService.java | 27 +++- .../route/NacosRegistryListener.java | 14 +- .../gatewaycommon/route/RegistryEvent.java | 23 ++++ .../sop/gateway/manager/DbEnvGrayManager.java | 27 ++-- .../gitee/sop/test/AlipayClientPostTest.java | 122 +----------------- 5 files changed, 81 insertions(+), 132 deletions(-) create mode 100644 sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/RegistryEvent.java diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ServerService.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ServerService.java index 4949567e..4880084f 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ServerService.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ServerService.java @@ -1,9 +1,12 @@ package com.gitee.sop.adminserver.service; +import com.gitee.fastmybatis.core.query.Query; import com.gitee.sop.adminserver.api.service.param.ServiceSearchParam; import com.gitee.sop.adminserver.api.service.result.ServiceInstanceVO; import com.gitee.sop.adminserver.bean.ServiceInfo; import com.gitee.sop.adminserver.bean.ServiceInstance; +import com.gitee.sop.adminserver.entity.ConfigGrayInstance; +import com.gitee.sop.adminserver.mapper.ConfigGrayInstanceMapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; @@ -12,8 +15,12 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import java.util.stream.Collectors; /** * @author tanghc @@ -22,9 +29,13 @@ import java.util.concurrent.atomic.AtomicInteger; @Service public class ServerService { + public static final int GRAY_OPEN = 1; @Autowired private RegistryService registryService; + @Autowired + private ConfigGrayInstanceMapper grayInstanceMapper; + public List listService(ServiceSearchParam param) { List serviceInfos; try { @@ -33,6 +44,10 @@ public class ServerService { log.error("获取服务实例失败", e); return Collections.emptyList(); } + List configGrayInstances = grayInstanceMapper.list(new Query()); + // key: instanceId + Map grayInstanceMap = configGrayInstances.stream() + .collect(Collectors.toMap(ConfigGrayInstance::getInstanceId, Function.identity())); List serviceInfoVoList = new ArrayList<>(); AtomicInteger idGen = new AtomicInteger(1); serviceInfos.stream() @@ -58,12 +73,22 @@ public class ServerService { instanceVO.setId(id); instanceVO.setParentId(pid); if (instanceVO.getMetadata() == null) { - instanceVO.setMetadata(Collections.emptyMap()); + instanceVO.setMetadata(new HashMap<>(8)); } + bindGrayEnv(instanceVO, grayInstanceMap); serviceInfoVoList.add(instanceVO); } }); return serviceInfoVoList; } + + private void bindGrayEnv(ServiceInstanceVO instanceVO, Map grayInstanceMap) { + String instanceId = instanceVO.getInstanceId(); + ConfigGrayInstance configGrayInstance = grayInstanceMap.get(instanceId); + if (configGrayInstance != null && configGrayInstance.getStatus() == GRAY_OPEN) { + Map metadata = instanceVO.getMetadata(); + metadata.put("env", "gray"); + } + } } diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/NacosRegistryListener.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/NacosRegistryListener.java index bf9a6dce..a514f1b1 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/NacosRegistryListener.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/NacosRegistryListener.java @@ -33,6 +33,9 @@ public class NacosRegistryListener extends BaseRegistryListener { @Autowired private NacosDiscoveryProperties nacosDiscoveryProperties; + @Autowired(required = false) + private List registryEventList; + @Override public synchronized void onEvent(ApplicationEvent applicationEvent) { NamingService namingService = nacosDiscoveryProperties.namingServiceInstance(); @@ -86,13 +89,21 @@ public class NacosRegistryListener extends BaseRegistryListener { instanceDefinition.setPort(instance.getPort()); instanceDefinition.setMetadata(instance.getMetadata()); pullRoutes(instanceDefinition); + if (registryEventList != null) { + registryEventList.forEach(registryEvent -> registryEvent.onRegistry(instanceDefinition)); + } }); } // 如果有服务删除 Set removedServiceIdList = getRemovedServiceId(serviceNames); if (removedServiceIdList.size() > 0) { - removedServiceIdList.forEach(this::removeRoutes); + removedServiceIdList.forEach(serviceId->{ + this.removeRoutes(serviceId); + if (registryEventList != null) { + registryEventList.forEach(registryEvent -> registryEvent.onRemove(serviceId)); + } + }); } cacheServices = new HashSet<>(serviceNames); @@ -111,7 +122,6 @@ public class NacosRegistryListener extends BaseRegistryListener { return cache; } - @Data @AllArgsConstructor private static class InstanceInfo { diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/RegistryEvent.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/RegistryEvent.java new file mode 100644 index 00000000..5baf8c42 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/route/RegistryEvent.java @@ -0,0 +1,23 @@ +package com.gitee.sop.gatewaycommon.route; + +import com.gitee.sop.gatewaycommon.bean.InstanceDefinition; + +/** + * 新的实例注册事件 + * + * @author tanghc + */ +public interface RegistryEvent { + + /** + * 新实例注册进来时触发 + * @param instanceDefinition 实例信息 + */ + void onRegistry(InstanceDefinition instanceDefinition); + + /** + * 服务下线时触发 + * @param serviceId 服务id + */ + void onRemove(String serviceId); +} diff --git a/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbEnvGrayManager.java b/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbEnvGrayManager.java index c44c5ec5..4bf774d9 100644 --- a/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbEnvGrayManager.java +++ b/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbEnvGrayManager.java @@ -6,8 +6,10 @@ import com.gitee.sop.gateway.entity.ConfigGrayInstance; import com.gitee.sop.gateway.mapper.ConfigGrayInstanceMapper; import com.gitee.sop.gateway.mapper.ConfigGrayMapper; import com.gitee.sop.gatewaycommon.bean.ChannelMsg; +import com.gitee.sop.gatewaycommon.bean.InstanceDefinition; import com.gitee.sop.gatewaycommon.bean.ServiceGrayDefinition; import com.gitee.sop.gatewaycommon.manager.DefaultEnvGrayManager; +import com.gitee.sop.gatewaycommon.route.RegistryEvent; import com.gitee.sop.gatewaycommon.zuul.loadbalancer.ServiceGrayConfig; import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; @@ -30,7 +32,7 @@ import java.util.stream.Stream; */ @Slf4j @Service -public class DbEnvGrayManager extends DefaultEnvGrayManager { +public class DbEnvGrayManager extends DefaultEnvGrayManager implements RegistryEvent { private static final int STATUS_ENABLE = 1; @@ -44,19 +46,26 @@ public class DbEnvGrayManager extends DefaultEnvGrayManager { private ConfigGrayInstanceMapper configGrayInstanceMapper; @Override - public void load() { + public void onRegistry(InstanceDefinition instanceDefinition) { + String instanceId = instanceDefinition.getInstanceId(); + ConfigGrayInstance grayInstance = configGrayInstanceMapper.getByColumn("instance_id", instanceId); + if (grayInstance != null && grayInstance.getStatus() == STATUS_ENABLE) { + log.info("实例[{}]开启灰度发布", grayInstance.getInstanceId()); + this.openGray(grayInstance.getInstanceId(), grayInstance.getServiceId()); + } + } + @Override + public void onRemove(String serviceId) { + + } + + @Override + public void load() { List list = configGrayMapper.list(new Query()); for (ConfigGray configGray : list) { this.setServiceGrayConfig(configGray); } - - Query query = new Query(); - query.eq("status", STATUS_ENABLE); - List grayInstanceList = configGrayInstanceMapper.list(query); - for (ConfigGrayInstance configGrayInstance : grayInstanceList) { - this.openGray(configGrayInstance.getInstanceId(), configGrayInstance.getServiceId()); - } } /** 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 82d76fa1..08d062b2 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 @@ -1,7 +1,6 @@ package com.gitee.sop.test; import com.alibaba.fastjson.JSON; -import com.gitee.sop.test.alipay.AlipayApiException; import com.gitee.sop.test.alipay.AlipaySignature; import org.junit.Test; @@ -37,6 +36,8 @@ 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); @@ -71,123 +72,4 @@ public class AlipayClientPostTest extends TestBase { } - - // 忽略验证,不校验签名,只需传接口名、版本号、业务参数 - @Test - public void testIgnore() { - // 公共请求参数 - Map params = new HashMap(); - params.put("method", "story.get"); - params.put("version", "2.1"); - // 业务参数 - Map bizContent = new HashMap<>(); - bizContent.put("id", "222"); - bizContent.put("name", "忽略验证name"); - - params.put("biz_content", JSON.toJSONString(bizContent)); - - System.out.println("----------- 返回结果 -----------"); - String responseData = post(url, params);// 发送请求 - System.out.println(responseData); - } - - @Test - public void testStoryget() throws AlipayApiException { - // 公共请求参数 - Map params = new HashMap(); - params.put("app_id", appId); - params.put("method", "story.get"); - params.put("version", "2.2"); - 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())); - // 业务参数 - Map bizContent = new HashMap<>(); - bizContent.put("id", "222"); - bizContent.put("name", "忽略验证22"); - - 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("----------- 返回结果 -----------"); - String responseData = post(url, params);// 发送请求 - System.out.println(responseData); - } - - @Test - public void testGetStory2() throws AlipayApiException { - // 公共请求参数 - Map params = new HashMap(); - params.put("app_id", appId); - params.put("method", "getStory2"); - params.put("version", "1.0"); - 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())); - // 业务参数 - Map bizContent = new HashMap<>(); - bizContent.put("name", "Jim"); - bizContent.put("age", "2"); - - 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("----------- 返回结果 -----------"); - String responseData = get(url, params);// 发送请求 - System.out.println(responseData); - } - - @Test - public void testGetJson() throws AlipayApiException { - // 公共请求参数 - Map params = new HashMap(); - params.put("app_id", appId); - params.put("method", "getJson"); - params.put("version", "1.0"); - 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())); - // 业务参数 - Map bizContent = new HashMap<>(); - bizContent.put("name", "Jim"); - bizContent.put("age", "2"); - - 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("----------- 返回结果 -----------"); - String responseData = get(url, params);// 发送请求 - System.out.println(responseData); - } - } From 739545526e67a7c4826758a4b6fc14da8aa500ff Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 12 Jun 2020 09:54:14 +0800 Subject: [PATCH 04/10] 3.2.0 --- pom.xml | 228 +++++++++++++++++++++++++- sop-admin/pom.xml | 9 +- sop-admin/sop-admin-server/pom.xml | 55 +------ sop-auth/pom.xml | 48 +----- sop-common/pom.xml | 171 +------------------ sop-common/sop-bridge-gateway/pom.xml | 6 +- sop-common/sop-bridge-zuul/pom.xml | 7 +- sop-common/sop-gateway-common/pom.xml | 14 +- sop-common/sop-service-common/pom.xml | 17 +- sop-example/pom.xml | 9 +- sop-example/sop-springmvc/pom.xml | 15 +- sop-example/sop-story/pom.xml | 48 +----- sop-gateway/pom.xml | 50 +----- sop-sdk/pom.xml | 9 +- sop-sdk/sdk-java/pom.xml | 12 +- sop-test/pom.xml | 50 +----- sop-website/pom.xml | 61 +------ 17 files changed, 338 insertions(+), 471 deletions(-) diff --git a/pom.xml b/pom.xml index ca648159..b07be6b7 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,18 @@ + + org.springframework.boot + spring-boot-starter-parent + 2.2.5.RELEASE + + + 4.0.0 com.gitee.sop sop-parent 1.0.0-SNAPSHOT pom - 一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台 @@ -21,4 +27,224 @@ sop-sdk sop-website + + + 1.8 + + UTF-8 + 1.8 + 1.8 + + + 2.2.5.RELEASE + + Hoxton.SR3 + + + 2.2.1.RELEASE + + + + 1.2.3 + 1.7.5 + + + 4.11 + + 1.2.70 + 2.5 + 1.3.3 + 3.2.2 + 3.8.1 + 1.11 + 1.2 + 2.0.1.Final + 6.0.13.Final + 1.8.6.1 + 2.3.0.RELEASE + 27.1-jre + 1.5.21 + 2.9.2 + 1.16.9 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + com.google.guava + guava + ${guava.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + net.oschina.durcframework + fastmybatis-spring-boot-starter + ${fastmybatis.version} + + + + io.springfox + springfox-spring-web + ${springfox-spring-web.version} + + + io.swagger + swagger-annotations + ${swagger.version} + + + + net.oschina.durcframework + easyopen + ${easyopen.version} + + + + net.oschina.durcframework + easyopen-spring-boot-starter + ${easyopen.version} + + + + javax.validation + validation-api + ${validation-api.version} + + + org.hibernate + hibernate-validator + ${hibernate-validator.version} + + + + ch.qos.logback + logback-classic + ${logback.version} + + + + org.springframework.data + spring-data-redis + ${spring-data-redis.version} + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + commons-collections + commons-collections + ${commons-collection.version} + + + commons-io + commons-io + ${commons-io.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + commons-fileupload + commons-fileupload + ${commons-fileupload.version} + + + commons-logging + commons-logging + ${commons-logging.version} + + + + org.projectlombok + lombok + 1.18.4 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + ${java.version} + ${java.version} + UTF-8 + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + \ No newline at end of file diff --git a/sop-admin/pom.xml b/sop-admin/pom.xml index bf55daf0..43d110ba 100644 --- a/sop-admin/pom.xml +++ b/sop-admin/pom.xml @@ -2,8 +2,15 @@ + + + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml + + 4.0.0 - com.gitee.sop sop-admin 1.0.0-SNAPSHOT pom diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index 32f4ac06..00ca5cd8 100644 --- a/sop-admin/sop-admin-server/pom.xml +++ b/sop-admin/sop-admin-server/pom.xml @@ -1,62 +1,25 @@ - 4.0.0 + - org.springframework.boot - spring-boot-starter-parent - 2.2.5.RELEASE - + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml - com.gitee.sop + + 4.0.0 sop-admin-server 1.0.0-SNAPSHOT jar - sop-admin-server - sop-admin-server - 1.8 UTF-8 UTF-8 - 3.11.0 - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - - com.alibaba.cloud @@ -67,19 +30,16 @@ net.oschina.durcframework easyopen-spring-boot-starter - 1.16.6.1 net.oschina.durcframework fastmybatis-spring-boot-starter - 1.8.6.1 com.squareup.okhttp3 okhttp - ${okhttp.version} @@ -92,6 +52,7 @@ org.springframework.boot spring-boot-starter-web + org.springframework.boot spring-boot-starter-thymeleaf diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml index 77bcb6f2..313805ee 100644 --- a/sop-auth/pom.xml +++ b/sop-auth/pom.xml @@ -1,58 +1,24 @@ - 4.0.0 + - org.springframework.boot - spring-boot-starter-parent - 2.2.5.RELEASE - + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml - com.gitee.sop + + 4.0.0 sop-auth - 1.0.0-SNAPSHOT sop-auth 授权程序 1.8 - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - 0.31 - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - - diff --git a/sop-common/pom.xml b/sop-common/pom.xml index 16fd62f7..00e5bfdd 100644 --- a/sop-common/pom.xml +++ b/sop-common/pom.xml @@ -2,45 +2,21 @@ + + + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml + + 4.0.0 - com.gitee.sop sop-common 3.2.0-SNAPSHOT pom 1.8 - - - UTF-8 - 1.8 - 1.8 - - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - - - - 1.0.13 - 1.7.5 - - - 4.11 - - 1.2.62 - 2.5 - 1.3.3 - 3.2.2 - 3.8.1 - 1.11 - 2.0.1.Final - 6.0.13.Final - 0.9.0.RELEASE @@ -50,136 +26,5 @@ sop-bridge-gateway - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - com.alibaba - fastjson - ${fastjson.version} - - - - javax.validation - validation-api - ${validation-api.version} - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - - org.springframework.data - spring-data-redis - 2.3.0.RELEASE - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - commons-collections - commons-collections - ${commons-collection.version} - - - commons-io - commons-io - ${commons-io.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - - - org.projectlombok - lombok - 1.18.4 - - - javax.servlet - javax.servlet-api - 3.1.0 - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - ${java.version} - ${java.version} - UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - \ No newline at end of file diff --git a/sop-common/sop-bridge-gateway/pom.xml b/sop-common/sop-bridge-gateway/pom.xml index 23201106..89b05e72 100644 --- a/sop-common/sop-bridge-gateway/pom.xml +++ b/sop-common/sop-bridge-gateway/pom.xml @@ -3,10 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - sop-common com.gitee.sop - 3.2.0-SNAPSHOT - ../pom.xml + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml 4.0.0 3.2.0-SNAPSHOT diff --git a/sop-common/sop-bridge-zuul/pom.xml b/sop-common/sop-bridge-zuul/pom.xml index d819ab40..58ba3568 100644 --- a/sop-common/sop-bridge-zuul/pom.xml +++ b/sop-common/sop-bridge-zuul/pom.xml @@ -3,11 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - sop-common com.gitee.sop - 3.2.0-SNAPSHOT - ../pom.xml + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml + 4.0.0 3.2.0-SNAPSHOT diff --git a/sop-common/sop-gateway-common/pom.xml b/sop-common/sop-gateway-common/pom.xml index 59826f50..d231e93b 100644 --- a/sop-common/sop-gateway-common/pom.xml +++ b/sop-common/sop-gateway-common/pom.xml @@ -1,20 +1,19 @@ - 4.0.0 + com.gitee.sop - sop-common - 3.2.0-SNAPSHOT - ../pom.xml + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml + + 4.0.0 sop-gateway-common 3.2.0-SNAPSHOT jar - sop-gateway-common - sop-gateway-common - 1.8 @@ -23,7 +22,6 @@ com.google.guava guava - 27.1-jre diff --git a/sop-common/sop-service-common/pom.xml b/sop-common/sop-service-common/pom.xml index f9008d18..20ca41a9 100644 --- a/sop-common/sop-service-common/pom.xml +++ b/sop-common/sop-service-common/pom.xml @@ -2,20 +2,19 @@ - 4.0.0 + com.gitee.sop - sop-common - 3.2.0-SNAPSHOT - ../pom.xml + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml + + 4.0.0 sop-service-common 3.2.0-SNAPSHOT jar - sop-service-common - sop-service-common - 1.8 @@ -25,7 +24,6 @@ com.google.guava guava - 27.1-jre @@ -48,19 +46,16 @@ net.oschina.durcframework easyopen - 1.16.1 true io.springfox springfox-spring-web - 2.9.2 true io.swagger swagger-annotations - 1.5.21 true diff --git a/sop-example/pom.xml b/sop-example/pom.xml index f7339103..985954fc 100644 --- a/sop-example/pom.xml +++ b/sop-example/pom.xml @@ -2,10 +2,15 @@ + + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml + + 4.0.0 - com.gitee.sop sop-example - 1.0.0-SNAPSHOT pom diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml index fcfff410..43efd3c4 100644 --- a/sop-example/sop-springmvc/pom.xml +++ b/sop-example/sop-springmvc/pom.xml @@ -1,12 +1,18 @@ + + + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml + + 4.0.0 - com.gitee.sop sop-springmvc sop-springmvc war - 1.0.0-SNAPSHOT 1.8 @@ -43,6 +49,11 @@ ${org.springframework-version} + + org.hibernate.validator + hibernate-validator + + com.fasterxml.jackson.core diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml index 915113ab..5fdc63bd 100644 --- a/sop-example/sop-story/pom.xml +++ b/sop-example/sop-story/pom.xml @@ -1,56 +1,20 @@ - 4.0.0 - org.springframework.boot - spring-boot-starter-parent - 2.2.5.RELEASE - + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml - com.gitee.sop + + 4.0.0 sop-story - 0.0.1-SNAPSHOT - sop-story - Demo project for Spring Boot 1.8 - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - - com.gitee.sop diff --git a/sop-gateway/pom.xml b/sop-gateway/pom.xml index afa163a9..cd7f9651 100644 --- a/sop-gateway/pom.xml +++ b/sop-gateway/pom.xml @@ -1,57 +1,20 @@ - 4.0.0 - org.springframework.boot - spring-boot-starter-parent - 2.2.5.RELEASE - + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml - com.gitee.sop + + 4.0.0 sop-gateway - 1.0.0-SNAPSHOT - sop-gateway - Demo project for Spring Boot 1.8 - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - - + + 4.0.0 - com.gitee.sop sop-sdk 1.0.0-SNAPSHOT pom diff --git a/sop-sdk/sdk-java/pom.xml b/sop-sdk/sdk-java/pom.xml index d7f37743..28fe5475 100644 --- a/sop-sdk/sdk-java/pom.xml +++ b/sop-sdk/sdk-java/pom.xml @@ -1,7 +1,14 @@ + + + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../../pom.xml + + 4.0.0 - com.gitee.sop sdk-java 1.0.0-SNAPSHOT @@ -17,20 +24,17 @@ com.squareup.okhttp3 okhttp - 3.14.0 com.alibaba fastjson - 1.2.62 commons-logging commons-logging - 1.2 diff --git a/sop-test/pom.xml b/sop-test/pom.xml index c6e167f5..14da7a43 100644 --- a/sop-test/pom.xml +++ b/sop-test/pom.xml @@ -3,16 +3,15 @@ - sop-parent com.gitee.sop + sop-parent 1.0.0-SNAPSHOT + ../pom.xml - 4.0.0 + 4.0.0 sop-test - sop-test - UTF-8 1.8 @@ -22,24 +21,19 @@ com.squareup.okhttp3 okhttp - 3.14.0 - compile commons-io commons-io - 2.5 com.alibaba fastjson - 1.2.62 + commons-codec commons-codec - 1.11 - compile org.projectlombok @@ -56,40 +50,4 @@ - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - ${java.version} - ${java.version} - UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - diff --git a/sop-website/pom.xml b/sop-website/pom.xml index bd1e6edb..c299458c 100644 --- a/sop-website/pom.xml +++ b/sop-website/pom.xml @@ -1,57 +1,21 @@ - 4.0.0 + - org.springframework.boot - spring-boot-starter-parent - 2.2.5.RELEASE - + com.gitee.sop + sop-parent + 1.0.0-SNAPSHOT + ../pom.xml - com.gitee.sop + + 4.0.0 sop-website - 1.0.0-SNAPSHOT - sop-website - sop-website 1.8 - - 2.2.5.RELEASE - - Hoxton.SR3 - - - 2.2.1.RELEASE - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - ${spring-cloud-alibaba.version} - pom - import - - - - com.gitee.sop @@ -70,28 +34,21 @@ - commons-lang - commons-lang - 2.6 - compile + org.apache.commons + commons-lang3 com.squareup.okhttp3 okhttp - 3.14.0 - compile com.alibaba fastjson - 1.2.62 - compile org.apache.httpcomponents httpclient - 4.5.6 From 131e7b9403456f155007b9d9d6004908a52b17ba Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 12 Jun 2020 09:58:22 +0800 Subject: [PATCH 05/10] 3.2.0 --- doc/docs/_sidebar.md | 74 ++++++++++++++-------------- doc/docs/files/10010_快速体验.md | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md index ce5dde51..a6b48b7e 100644 --- a/doc/docs/_sidebar.md +++ b/doc/docs/_sidebar.md @@ -1,39 +1,39 @@ -* [首页](/?t=1589794156310) +* [首页](/?t=1591927043815) * 开发文档 - * [快速体验](files/10010_快速体验.md?t=1589794156312) - * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1589794156333) - * [新增接口](files/10020_新增接口.md?t=1589794156333) - * [开发流程](files/10021_开发流程.md?t=1589794156333) - * [业务参数校验](files/10030_业务参数校验.md?t=1589794156333) - * [错误处理](files/10040_错误处理.md?t=1589794156333) - * [编写文档](files/10041_编写文档.md?t=1589794156333) - * [接口交互详解](files/10050_接口交互详解.md?t=1589794156333) - * [easyopen支持](files/10070_easyopen支持.md?t=1589794156333) - * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1589794156334) - * [ISV管理](files/10085_ISV管理.md?t=1589794156334) - * [自定义返回结果](files/10087_自定义返回结果.md?t=1589794156334) - * [自定义过滤器](files/10088_自定义过滤器.md?t=1589794156334) - * [自定义校验token](files/10089_自定义校验token.md?t=1589794156334) - * [网关拦截器](files/10090_网关拦截器.md?t=1589794156334) - * [路由授权](files/10090_路由授权.md?t=1589794156335) - * [接口限流](files/10092_接口限流.md?t=1589794156335) - * [路由监控](files/10093_路由监控.md?t=1589794156335) - * [SDK开发](files/10095_SDK开发.md?t=1589794156335) - * [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1589794156335) - * [应用授权](files/10097_应用授权.md?t=1589794156335) - * [提供restful接口](files/10100_提供restful接口.md?t=1589794156335) - * [文件上传](files/10104_文件上传.md?t=1589794156336) - * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1589794156336) - * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1589794156336) - * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1589794156336) - * [使用eureka](files/10112_使用eureka.md?t=1589794156336) - * [扩展其它注册中心](files/10113_扩展其它注册中心.md?t=1589794156336) + * [快速体验](files/10010_快速体验.md?t=1591927043817) + * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1591927043835) + * [新增接口](files/10020_新增接口.md?t=1591927043836) + * [开发流程](files/10021_开发流程.md?t=1591927043836) + * [业务参数校验](files/10030_业务参数校验.md?t=1591927043836) + * [错误处理](files/10040_错误处理.md?t=1591927043836) + * [编写文档](files/10041_编写文档.md?t=1591927043836) + * [接口交互详解](files/10050_接口交互详解.md?t=1591927043836) + * [easyopen支持](files/10070_easyopen支持.md?t=1591927043836) + * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1591927043836) + * [ISV管理](files/10085_ISV管理.md?t=1591927043836) + * [自定义返回结果](files/10087_自定义返回结果.md?t=1591927043837) + * [自定义过滤器](files/10088_自定义过滤器.md?t=1591927043837) + * [自定义校验token](files/10089_自定义校验token.md?t=1591927043837) + * [网关拦截器](files/10090_网关拦截器.md?t=1591927043837) + * [路由授权](files/10090_路由授权.md?t=1591927043837) + * [接口限流](files/10092_接口限流.md?t=1591927043837) + * [路由监控](files/10093_路由监控.md?t=1591927043837) + * [SDK开发](files/10095_SDK开发.md?t=1591927043837) + * [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1591927043837) + * [应用授权](files/10097_应用授权.md?t=1591927043837) + * [提供restful接口](files/10100_提供restful接口.md?t=1591927043838) + * [文件上传](files/10104_文件上传.md?t=1591927043838) + * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1591927043838) + * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1591927043838) + * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1591927043838) + * [使用eureka](files/10112_使用eureka.md?t=1591927043838) + * [扩展其它注册中心](files/10113_扩展其它注册中心.md?t=1591927043838) * 原理分析 - * [网关性能测试](files/90001_网关性能测试.md?t=1589794156336) - * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1589794156337) - * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1589794156337) - * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1589794156337) - * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1589794156337) - * [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1589794156337) - * [2.x升3.x注意事项](files/90099_2.x升3.x注意事项.md?t=1589794156337) - * [常见问题](files/90100_常见问题.md?t=1589794156337) + * [网关性能测试](files/90001_网关性能测试.md?t=1591927043838) + * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1591927043838) + * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1591927043838) + * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1591927043839) + * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1591927043839) + * [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1591927043839) + * [2.x升3.x注意事项](files/90099_2.x升3.x注意事项.md?t=1591927043839) + * [常见问题](files/90100_常见问题.md?t=1591927043839) diff --git a/doc/docs/files/10010_快速体验.md b/doc/docs/files/10010_快速体验.md index 8029b969..b27e9ae4 100644 --- a/doc/docs/files/10010_快速体验.md +++ b/doc/docs/files/10010_快速体验.md @@ -12,7 +12,7 @@ - 启动微服务:打开`sop-example/sop-story/sop-story-web`下的`application-dev.properties`文件 1. 指定nacos地址,如果nacos安装在本机则不用改 2. 运行`SopStoryApplication.java` -- 找到sop-test,打开`AllInOneTest.java`进行接口调用测试 +- 找到sop-test,运行`com.gitee.sop.test.AlipayClientPostTest.testGet`进行接口调用测试 ## 使用admin From 007c52b174b6aff64a9ef07a371081347835018e Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 12 Jun 2020 10:00:56 +0800 Subject: [PATCH 06/10] 3.2.0 --- changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.md b/changelog.md index 19f075e6..c6822c03 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,9 @@ Hoxton.SR3(Spring Cloud Version), 2.2.1.RELEASE(Spring Cloud Alibaba Version), 2.2.5.RELEASE(Spring Boot Version) +- 优化pom文件 +- 优化灰度发布 + ## 3.1.5 修复文件上传大小不一致问题 From d943377c00108faa5237076a95eea8d30aec12a3 Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 15 Jun 2020 14:34:47 +0800 Subject: [PATCH 07/10] 3.2.0 --- doc/docs/files/10092_接口限流.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/docs/files/10092_接口限流.md b/doc/docs/files/10092_接口限流.md index 2c36cd00..8f1c9ef8 100644 --- a/doc/docs/files/10092_接口限流.md +++ b/doc/docs/files/10092_接口限流.md @@ -67,15 +67,14 @@ spring.redis.host=127.0.0.1 spring.redis.port=6379 ``` -- ZuulConfig.java中添加如下代码: +- 在启动类中添加如下代码: ```java @Autowired private RedisTemplate redisTemplate; -@Override -protected void doAfter() { - super.doAfter(); +@PostConstruct +public void doAfter() { ApiConfig.getInstance().setLimitManager(new RedisLimitManager(redisTemplate)); } ``` From 70a23d1d44d8b8147437a35bc4fa8e6175db8fc0 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 16 Jun 2020 09:46:31 +0800 Subject: [PATCH 08/10] 3.2.0 --- doc/docs/files/10087_自定义返回结果.md | 2 +- pom.xml | 2 +- sop-auth/pom.xml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/docs/files/10087_自定义返回结果.md b/doc/docs/files/10087_自定义返回结果.md index 352f7ccf..123cf503 100644 --- a/doc/docs/files/10087_自定义返回结果.md +++ b/doc/docs/files/10087_自定义返回结果.md @@ -78,7 +78,7 @@ public class ZuulConfig extends AlipayZuulConfiguration { } ``` -**注**:网关设置了CustomDataNameBuilder后,SDK也要做相应的更改:`SdkConfig.dataNameBuilder = new CustomDataNameBuilder();` +**注**:网关设置了CustomDataNameBuilder后,SDK也要做相应的更改:`OpenConfig.dataNameBuilder = new CustomDataNameBuilder();` ## 自定义结果处理 diff --git a/pom.xml b/pom.xml index b07be6b7..ffd2adce 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.2 2.0.1.Final 6.0.13.Final - 1.8.6.1 + 1.9.1 2.3.0.RELEASE 27.1-jre 1.5.21 diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml index 313805ee..09f02e60 100644 --- a/sop-auth/pom.xml +++ b/sop-auth/pom.xml @@ -50,7 +50,6 @@ net.oschina.durcframework fastmybatis-spring-boot-starter - 1.7.1 mysql From 2588014b6eec0427bc8bbe4a980aa8782a30810d Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 16 Jun 2020 11:19:16 +0800 Subject: [PATCH 09/10] 3.2.0 --- .../com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java index 3cabfd59..4acfac37 100644 --- a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit; * oauth2管理redis实现,这个类跟OAuth2ManagerCache类只能用一个, * 如果要用这个类, * 1、注释掉OAuth2ManagerCache的@Service。 - * 2、打开yml中redis部分 + * 2、在properties中配置redis * 3、启用这个类的@Service * * @author tanghc From 04a1a05127253dc52bdcf2a1dc873f4638afb4ab Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 16 Jun 2020 18:02:41 +0800 Subject: [PATCH 10/10] 3.2.0 --- .../com/gitee/sop/adminserver/entity/ConfigServiceRoute.java | 4 ++-- .../java/com/gitee/sop/gateway/entity/ConfigServiceRoute.java | 4 ++-- .../java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java | 2 +- sop-mysql5.6以下版本.sql | 2 +- sop.sql | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/entity/ConfigServiceRoute.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/entity/ConfigServiceRoute.java index 0234fb21..30b817af 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/entity/ConfigServiceRoute.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/entity/ConfigServiceRoute.java @@ -46,8 +46,8 @@ public class ConfigServiceRoute { /** uri后面跟的path, 数据库字段:path */ private String path; - /** 路由执行的顺序, 数据库字段:order */ - private Integer order; + /** 路由执行的顺序, 数据库字段:order_index */ + private Integer orderIndex; /** 是否忽略验证,业务参数验证除外, 数据库字段:ignore_validate */ private Byte ignoreValidate; diff --git a/sop-gateway/src/main/java/com/gitee/sop/gateway/entity/ConfigServiceRoute.java b/sop-gateway/src/main/java/com/gitee/sop/gateway/entity/ConfigServiceRoute.java index dbed6fa8..855fbfa7 100644 --- a/sop-gateway/src/main/java/com/gitee/sop/gateway/entity/ConfigServiceRoute.java +++ b/sop-gateway/src/main/java/com/gitee/sop/gateway/entity/ConfigServiceRoute.java @@ -46,8 +46,8 @@ public class ConfigServiceRoute { /** uri后面跟的path, 数据库字段:path */ private String path; - /** 路由执行的顺序, 数据库字段:order */ - private Integer order; + /** 路由执行的顺序, 数据库字段:order_index */ + private Integer orderIndex; /** 是否忽略验证,业务参数验证除外, 数据库字段:ignore_validate */ private Byte ignoreValidate; diff --git a/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java b/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java index ca0a21be..6740f2d8 100644 --- a/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java +++ b/sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java @@ -59,7 +59,7 @@ public class DbRoutesProcessor implements RoutesProcessor { configServiceRoute.setMergeResult((byte) routeDefinition.getMergeResult()); configServiceRoute.setStatus((byte) routeDefinition.getStatus()); configServiceRoute.setPermission((byte) routeDefinition.getPermission()); - configServiceRoute.setOrder(routeDefinition.getOrder()); + configServiceRoute.setOrderIndex(routeDefinition.getOrder()); configServiceRoute.setNeedToken((byte)routeDefinition.getNeedToken()); configServiceRoute.setServiceId(serviceId); return configServiceRoute; diff --git a/sop-mysql5.6以下版本.sql b/sop-mysql5.6以下版本.sql index 7d0cd7fa..d56a288c 100644 --- a/sop-mysql5.6以下版本.sql +++ b/sop-mysql5.6以下版本.sql @@ -222,7 +222,7 @@ CREATE TABLE `config_service_route` ( `filters` VARCHAR(256) DEFAULT NULL COMMENT '路由过滤器(SpringCloudGateway专用)', `uri` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '路由规则转发的目标uri', `path` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'uri后面跟的path', - `order` INT(11) NOT NULL DEFAULT '0' COMMENT '路由执行的顺序', + `order_index` INT(11) NOT NULL DEFAULT '0' COMMENT '路由执行的顺序', `ignore_validate` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否忽略验证,业务参数验证除外', `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '状态,0:待审核,1:启用,2:禁用', `merge_result` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否合并结果', diff --git a/sop.sql b/sop.sql index 4df5d424..a9f95d31 100644 --- a/sop.sql +++ b/sop.sql @@ -224,7 +224,7 @@ CREATE TABLE `config_service_route` ( `filters` varchar(256) DEFAULT NULL COMMENT '路由过滤器(SpringCloudGateway专用)', `uri` varchar(128) NOT NULL DEFAULT '' COMMENT '路由规则转发的目标uri', `path` varchar(128) NOT NULL DEFAULT '' COMMENT 'uri后面跟的path', - `order` int(11) NOT NULL DEFAULT '0' COMMENT '路由执行的顺序', + `order_index` int(11) NOT NULL DEFAULT '0' COMMENT '路由执行的顺序', `ignore_validate` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否忽略验证,业务参数验证除外', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态,0:待审核,1:启用,2:禁用', `merge_result` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否合并结果',