From 57882206d37b9bfbfc2ea8918ea30da055a4682d Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 1 Feb 2021 12:49:12 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=203.0.1.RELEASE=20=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=80=82=E9=85=8D=20SpringCloud=202020.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- blade-auth/pom.xml | 2 +- blade-common/pom.xml | 2 +- .../common/launch/LauncherServiceImpl.java | 1 - blade-gateway/pom.xml | 29 +------ .../gateway/GateWayApplication.java | 8 +- .../config/RouterFunctionConfiguration.java | 25 +----- .../gateway/filter/AuthFilter.java | 6 +- .../handler/ErrorExceptionHandler.java | 4 + .../handler/SwaggerResourceHandler.java | 54 ------------- .../handler/SwaggerSecurityHandler.java | 51 ------------- .../gateway/handler/SwaggerUiHandler.java | 51 ------------- .../gateway/props/RouteProperties.java | 37 --------- .../gateway/provider/AuthProvider.java | 2 +- .../gateway/provider/SwaggerProvider.java | 59 -------------- .../src/main/resources/bootstrap.yml | 11 --- blade-ops/blade-admin/pom.xml | 2 +- blade-ops/blade-develop/pom.xml | 2 +- blade-ops/blade-report/pom.xml | 47 +++++++++++- blade-ops/blade-resource/pom.xml | 2 +- blade-ops/blade-seata-order/pom.xml | 2 +- blade-ops/blade-seata-storage/pom.xml | 2 +- blade-ops/blade-swagger/Dockerfile | 15 ++++ blade-ops/blade-swagger/pom.xml | 76 +++++++++++++++++++ .../swagger/SwaggerApplication.java | 29 +++---- .../src/main/resources/application.yml | 16 ++++ .../src/main/resources/banner.txt | 10 +++ blade-ops/pom.xml | 3 +- blade-service-api/blade-demo-api/pom.xml | 2 +- blade-service-api/blade-desk-api/pom.xml | 2 +- blade-service-api/blade-dict-api/pom.xml | 2 +- blade-service-api/blade-system-api/pom.xml | 2 +- blade-service-api/blade-user-api/pom.xml | 2 +- blade-service-api/pom.xml | 4 +- blade-service/blade-demo/pom.xml | 2 +- blade-service/blade-desk/pom.xml | 2 +- blade-service/blade-log/pom.xml | 2 +- blade-service/blade-system/pom.xml | 2 +- blade-service/blade-user/pom.xml | 2 +- blade-service/pom.xml | 4 +- doc/nacos/blade.yaml | 26 ++++++- doc/sql/blade/blade-update-2.7.3~2.8.0.sql | 32 -------- pom.xml | 16 ++-- script/docker/.env | 2 +- script/docker/deploy.sh | 3 +- script/docker/docker-compose.yml | 9 +++ 46 files changed, 255 insertions(+), 417 deletions(-) delete mode 100644 blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java delete mode 100644 blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java delete mode 100644 blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java delete mode 100644 blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java delete mode 100644 blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java create mode 100644 blade-ops/blade-swagger/Dockerfile create mode 100644 blade-ops/blade-swagger/pom.xml rename blade-gateway/src/main/java/org/springblade/gateway/props/RouteResource.java => blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java (64%) create mode 100644 blade-ops/blade-swagger/src/main/resources/application.yml create mode 100644 blade-ops/blade-swagger/src/main/resources/banner.txt delete mode 100644 doc/sql/blade/blade-update-2.7.3~2.8.0.sql diff --git a/README.md b/README.md index 181f59a..ff88481 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- Downloads + Downloads Build Status Build Status Coverage Status - Downloads + Downloads Downloads @@ -70,12 +70,12 @@ SpringBlade ## 技术文档 * [SpringBlade开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) -* [常见问题集锦](https://sns.bladex.vip/article-14966.html) +* [SpringBlade常见问题集锦](https://sns.bladex.vip/article-14966.html) ## 项目地址 * 后端Gitee地址:[https://gitee.com/smallc/SpringBlade](https://gitee.com/smallc/SpringBlade) * 后端Github地址:[https://github.com/chillzhuang/SpringBlade](https://github.com/chillzhuang/SpringBlade) -* 后端SpringBoot版:[https://gitee.com/smallc/SpringBlade/tree/2.0-boot/](https://gitee.com/smallc/SpringBlade/tree/2.0-boot/) +* 后端SpringBoot版:[https://gitee.com/smallc/SpringBlade/tree/boot/](https://gitee.com/smallc/SpringBlade/tree/boot/) * 前端框架Sword(基于React):[https://gitee.com/smallc/Sword](https://gitee.com/smallc/Sword) * 前端框架Saber(基于Vue):[https://gitee.com/smallc/Saber](https://gitee.com/smallc/Saber) * 核心框架项目地址:[https://github.com/chillzhuang/blade-tool](https://github.com/chillzhuang/blade-tool) diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index d138319..1f6d59f 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ SpringBlade org.springblade - 3.0.0 + 3.0.1 blade-auth diff --git a/blade-common/pom.xml b/blade-common/pom.xml index 90eb813..79dda3c 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java index 150c14c..d9bd33c 100644 --- a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java +++ b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java @@ -15,7 +15,6 @@ */ package org.springblade.common.launch; -import org.springblade.common.constant.CommonConstant; import org.springblade.common.constant.LauncherConstant; import org.springblade.core.launch.service.LauncherService; import org.springframework.boot.builder.SpringApplicationBuilder; diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index 0d34807..3b481f1 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 3.0.0 + 3.0.1 4.0.0 @@ -92,33 +92,6 @@ jjwt-jackson 0.11.2 - - - io.springfox - springfox-swagger2 - ${swagger.version} - - - io.swagger - swagger-models - - - - - io.swagger - swagger-models - ${swagger.models.version} - - - com.github.xiaoymin - knife4j-spring-ui - ${knife4j.version} - - diff --git a/blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java b/blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java index 7458708..9d2f66a 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java @@ -15,9 +15,10 @@ */ package org.springblade.gateway; -import org.springblade.core.launch.constant.AppConstant; import org.springblade.core.launch.BladeApplication; -import org.springframework.cloud.client.SpringCloudApplication; +import org.springblade.core.launch.constant.AppConstant; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.scheduling.annotation.EnableScheduling; /** @@ -26,7 +27,8 @@ import org.springframework.scheduling.annotation.EnableScheduling; * @author Chill */ @EnableScheduling -@SpringCloudApplication +@EnableDiscoveryClient +@SpringBootApplication public class GateWayApplication { public static void main(String[] args) { diff --git a/blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java b/blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java index ed51982..53a2b39 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java @@ -18,18 +18,9 @@ package org.springblade.gateway.config; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springblade.gateway.handler.SwaggerResourceHandler; -import org.springblade.gateway.handler.SwaggerSecurityHandler; -import org.springblade.gateway.handler.SwaggerUiHandler; import org.springblade.gateway.props.AuthProperties; -import org.springblade.gateway.props.RouteProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.RequestPredicates; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.RouterFunctions; /** * 路由配置信息 @@ -39,21 +30,7 @@ import org.springframework.web.reactive.function.server.RouterFunctions; @Slf4j @Configuration @AllArgsConstructor -@EnableConfigurationProperties({RouteProperties.class, AuthProperties.class}) +@EnableConfigurationProperties({AuthProperties.class}) public class RouterFunctionConfiguration { - private final SwaggerResourceHandler swaggerResourceHandler; - private final SwaggerSecurityHandler swaggerSecurityHandler; - private final SwaggerUiHandler swaggerUiHandler; - - @Bean - public RouterFunction routerFunction() { - return RouterFunctions.route(RequestPredicates.GET("/swagger-resources") - .and(RequestPredicates.accept(MediaType.ALL)), swaggerResourceHandler) - .andRoute(RequestPredicates.GET("/swagger-resources/configuration/ui") - .and(RequestPredicates.accept(MediaType.ALL)), swaggerUiHandler) - .andRoute(RequestPredicates.GET("/swagger-resources/configuration/security") - .and(RequestPredicates.accept(MediaType.ALL)), swaggerSecurityHandler); - } - } diff --git a/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java b/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java index 47adfae..4de53bf 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java @@ -15,12 +15,12 @@ */ package org.springblade.gateway.filter; +import com.alibaba.nacos.common.utils.StringUtils; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.Claims; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springblade.gateway.props.AuthProperties; import org.springblade.gateway.provider.AuthProvider; import org.springblade.gateway.provider.ResponseProvider; @@ -47,8 +47,8 @@ import java.nio.charset.StandardCharsets; @Component @AllArgsConstructor public class AuthFilter implements GlobalFilter, Ordered { - private AuthProperties authProperties; - private ObjectMapper objectMapper; + private final AuthProperties authProperties; + private final ObjectMapper objectMapper; @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { diff --git a/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java b/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java index 5fe8340..ba0978e 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java @@ -76,6 +76,10 @@ public class ErrorExceptionHandler implements ErrorWebExceptionHandler { * 构建异常信息 */ private String buildMessage(ServerHttpRequest request, Throwable ex) { + String uri = request.getURI().toString(); + if (uri.endsWith("doc.html")) { + return "[Swagger聚合网关] 已迁移至 [blade-swagger] 服务,请开启 [blade-swagger] 服务并访问 [http://127.0.0.1:18000/doc.html]"; + } StringBuilder message = new StringBuilder("Failed to handle request ["); message.append(request.getMethodValue()); message.append(" "); diff --git a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java b/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java deleted file mode 100644 index 2885b31..0000000 --- a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springblade.gateway.handler; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; -import reactor.core.publisher.Mono; -import springfox.documentation.swagger.web.SwaggerResourcesProvider; - -/** - * SwaggerResourceHandler - * - * @author lengleng - */ -@Slf4j -@Component -@RequiredArgsConstructor -public class SwaggerResourceHandler implements HandlerFunction { - private final SwaggerResourcesProvider swaggerResources; - - /** - * Handle the given request. - * - * @param request the request to handler - * @return the response - */ - @Override - public Mono handle(ServerRequest request) { - return ServerResponse.status(HttpStatus.OK) - .contentType(MediaType.APPLICATION_JSON) - .body(BodyInserters.fromValue(swaggerResources.get())); - } -} diff --git a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java b/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java deleted file mode 100644 index d30f477..0000000 --- a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springblade.gateway.handler; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; -import reactor.core.publisher.Mono; -import springfox.documentation.swagger.web.SecurityConfigurationBuilder; - -/** - * SwaggerSecurityHandler - * - * @author lengleng - */ -@Slf4j -@Component -public class SwaggerSecurityHandler implements HandlerFunction { - - /** - * Handle the given request. - * - * @param request the request to handler - * @return the response - */ - @Override - public Mono handle(ServerRequest request) { - return ServerResponse.status(HttpStatus.OK) - .contentType(MediaType.APPLICATION_JSON) - .body(BodyInserters.fromValue(SecurityConfigurationBuilder.builder().build())); - } -} diff --git a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java b/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java deleted file mode 100644 index 8bb78af..0000000 --- a/blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springblade.gateway.handler; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.server.HandlerFunction; -import org.springframework.web.reactive.function.server.ServerRequest; -import org.springframework.web.reactive.function.server.ServerResponse; -import reactor.core.publisher.Mono; -import springfox.documentation.swagger.web.UiConfigurationBuilder; - -/** - * SwaggerUiHandler - * - * @author lengleng - */ -@Slf4j -@Component -public class SwaggerUiHandler implements HandlerFunction { - - /** - * Handle the given request. - * - * @param request the request to handler - * @return the response - */ - @Override - public Mono handle(ServerRequest request) { - return ServerResponse.status(HttpStatus.OK) - .contentType(MediaType.APPLICATION_JSON) - .body(BodyInserters.fromValue(UiConfigurationBuilder.builder().build())); - } -} diff --git a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java b/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java deleted file mode 100644 index 9b7aa5d..0000000 --- a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteProperties.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springblade.gateway.props; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.context.config.annotation.RefreshScope; - -import java.util.ArrayList; -import java.util.List; - -/** - * 路由配置类 - * - * @author Chill - */ -@Data -@RefreshScope -@ConfigurationProperties("blade.document") -public class RouteProperties { - - private final List resources = new ArrayList<>(); - -} diff --git a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java b/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java index 5be3862..a107e79 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java @@ -30,7 +30,7 @@ public class AuthProvider { public static String TARGET = "/**"; public static String REPLACEMENT = ""; public static String AUTH_KEY = TokenConstant.HEADER; - private static List defaultSkipUrl = new ArrayList<>(); + private static final List defaultSkipUrl = new ArrayList<>(); static { defaultSkipUrl.add("/example"); diff --git a/blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java b/blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java deleted file mode 100644 index c4700f2..0000000 --- a/blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springblade.gateway.provider; - -import lombok.AllArgsConstructor; -import org.springblade.gateway.props.RouteProperties; -import org.springblade.gateway.props.RouteResource; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Component; -import springfox.documentation.swagger.web.SwaggerResource; -import springfox.documentation.swagger.web.SwaggerResourcesProvider; - -import java.util.ArrayList; -import java.util.List; - -/** - * 聚合接口文档注册 - * - * @author Chill - */ -@Primary -@Component -@AllArgsConstructor -public class SwaggerProvider implements SwaggerResourcesProvider { - private static final String API_URI = "/v2/api-docs"; - - private RouteProperties routeProperties; - - @Override - public List get() { - List resources = new ArrayList<>(); - List routeResources = routeProperties.getResources(); - routeResources.forEach(routeResource -> resources.add(swaggerResource(routeResource))); - return resources; - } - - private SwaggerResource swaggerResource(RouteResource routeResource) { - SwaggerResource swaggerResource = new SwaggerResource(); - swaggerResource.setName(routeResource.getName()); - swaggerResource.setLocation(routeResource.getLocation().concat(API_URI)); - swaggerResource.setSwaggerVersion(routeResource.getVersion()); - return swaggerResource; - } - -} diff --git a/blade-gateway/src/main/resources/bootstrap.yml b/blade-gateway/src/main/resources/bootstrap.yml index b3a18ab..4172f5d 100644 --- a/blade-gateway/src/main/resources/bootstrap.yml +++ b/blade-gateway/src/main/resources/bootstrap.yml @@ -11,15 +11,4 @@ spring: retry: enabled: true -# 聚合文档配置 -blade: - document: - resources: - - name: 授权模块 - location: /blade-auth - - name: 工作台模块 - location: /blade-desk - - name: 系统模块 - location: /blade-system - diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index 0ef263d..03113ae 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index e0003b0..b9a752a 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-ops/blade-report/pom.xml b/blade-ops/blade-report/pom.xml index dcfa199..018a22f 100644 --- a/blade-ops/blade-report/pom.xml +++ b/blade-ops/blade-report/pom.xml @@ -5,7 +5,7 @@ org.springblade blade-ops - 3.0.0 + 3.0.1 4.0.0 @@ -34,4 +34,49 @@ + + + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + ${docker.registry.url}/blade/${project.artifactId}:${project.version} + ${project.basedir} + ${docker.registry.host} + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + ${docker.registry.url} + ${docker.registry.url} + true + + + + org.apache.maven.plugins + maven-antrun-plugin + + + package + + run + + + + + + + + + + + + + diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml index 13c0530..db4d541 100644 --- a/blade-ops/blade-resource/pom.xml +++ b/blade-ops/blade-resource/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-ops/blade-seata-order/pom.xml b/blade-ops/blade-seata-order/pom.xml index 70bf781..21a20c8 100644 --- a/blade-ops/blade-seata-order/pom.xml +++ b/blade-ops/blade-seata-order/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-ops/blade-seata-storage/pom.xml b/blade-ops/blade-seata-storage/pom.xml index 9475038..b2f6696 100644 --- a/blade-ops/blade-seata-storage/pom.xml +++ b/blade-ops/blade-seata-storage/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-ops/blade-swagger/Dockerfile b/blade-ops/blade-swagger/Dockerfile new file mode 100644 index 0000000..9692c6d --- /dev/null +++ b/blade-ops/blade-swagger/Dockerfile @@ -0,0 +1,15 @@ +FROM anapsix/alpine-java:8_server-jre_unlimited + +MAINTAINER smallchill@163.com + +RUN mkdir -p /blade/swagger + +WORKDIR /blade/swagger + +EXPOSE 18000 + +ADD ./target/blade-swagger.jar ./app.jar + +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] + +CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-swagger/pom.xml b/blade-ops/blade-swagger/pom.xml new file mode 100644 index 0000000..71dcad3 --- /dev/null +++ b/blade-ops/blade-swagger/pom.xml @@ -0,0 +1,76 @@ + + + + blade-ops + org.springblade + 3.0.1 + + 4.0.0 + + blade-swagger + ${project.artifactId} + ${blade.project.version} + jar + + + + org.springblade + blade-core-launch + ${blade.tool.version} + + + com.github.xiaoymin + knife4j-aggregation-spring-boot-starter + ${knife4j.version} + + + + + + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + ${docker.registry.url}/blade/${project.artifactId}:${project.version} + ${project.basedir} + ${docker.registry.host} + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + ${docker.registry.url} + ${docker.registry.url} + true + + + + org.apache.maven.plugins + maven-antrun-plugin + + + package + + run + + + + + + + + + + + + + + + diff --git a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteResource.java b/blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java similarity index 64% rename from blade-gateway/src/main/java/org/springblade/gateway/props/RouteResource.java rename to blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java index a279a40..4dd1c7d 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/props/RouteResource.java +++ b/blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java @@ -13,32 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springblade.gateway.props; +package org.springblade.swagger; -import lombok.Data; -import org.springblade.core.launch.constant.AppConstant; +import org.springblade.core.launch.BladeApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; /** - * Swagger聚合文档属性 + * swagger聚合启动器 * * @author Chill */ -@Data -public class RouteResource { +@SpringBootApplication +public class SwaggerApplication { - /** - * 文档名 - */ - private String name; - - /** - * 文档所在服务地址 - */ - private String location; - - /** - * 文档版本 - */ - private String version = AppConstant.APPLICATION_VERSION; + public static void main(String[] args) { + BladeApplication.run("blade-swagger", SwaggerApplication.class, args); + } } diff --git a/blade-ops/blade-swagger/src/main/resources/application.yml b/blade-ops/blade-swagger/src/main/resources/application.yml new file mode 100644 index 0000000..78296a6 --- /dev/null +++ b/blade-ops/blade-swagger/src/main/resources/application.yml @@ -0,0 +1,16 @@ +server: + port: 18000 +knife4j: + enableAggregation: true + cloud: + enable: true + routes: + - name: 授权模块 + uri: 127.0.0.1 + location: /blade-auth/v2/api-docs + - name: 工作台模块 + uri: 127.0.0.1 + location: /blade-desk/v2/api-docs + - name: 系统模块 + uri: 127.0.0.1 + location: /blade-system/v2/api-docs diff --git a/blade-ops/blade-swagger/src/main/resources/banner.txt b/blade-ops/blade-swagger/src/main/resources/banner.txt new file mode 100644 index 0000000..cbd0280 --- /dev/null +++ b/blade-ops/blade-swagger/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +${AnsiColor.BRIGHT_CYAN} _____ _ ${AnsiColor.BLUE} ______ _ _ +${AnsiColor.BRIGHT_CYAN}/ ___| (_) ${AnsiColor.BLUE} | ___ \| | | | +${AnsiColor.BRIGHT_CYAN}\ `--. _ __ _ __ _ _ __ __ _ ${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___ +${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \ / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \ +${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || | | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/ +${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_| |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___| +${AnsiColor.BRIGHT_CYAN} | | __/ | +${AnsiColor.BRIGHT_CYAN} |_| |___/ + +${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK} diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index fa2b127..25c21b3 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 3.0.0 + 3.0.1 4.0.0 @@ -18,6 +18,7 @@ blade-resource blade-seata-order blade-seata-storage + blade-swagger diff --git a/blade-service-api/blade-demo-api/pom.xml b/blade-service-api/blade-demo-api/pom.xml index d4d3d24..1492d69 100644 --- a/blade-service-api/blade-demo-api/pom.xml +++ b/blade-service-api/blade-demo-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index fdb3f7a..80e7d33 100644 --- a/blade-service-api/blade-desk-api/pom.xml +++ b/blade-service-api/blade-desk-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index aadb4e9..a32f373 100644 --- a/blade-service-api/blade-dict-api/pom.xml +++ b/blade-service-api/blade-dict-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index b5ad699..fa14a6f 100644 --- a/blade-service-api/blade-system-api/pom.xml +++ b/blade-service-api/blade-system-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index 623018c..e9bd58a 100644 --- a/blade-service-api/blade-user-api/pom.xml +++ b/blade-service-api/blade-user-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index 9fa544d..d910c51 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 3.0.0 + 3.0.1 4.0.0 blade-service-api ${project.artifactId} - 3.0.0 + 3.0.1 pom SpringBlade 微服务API集合 diff --git a/blade-service/blade-demo/pom.xml b/blade-service/blade-demo/pom.xml index c398d31..f82ae39 100644 --- a/blade-service/blade-demo/pom.xml +++ b/blade-service/blade-demo/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index af56f94..50f5bde 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml index 13ca12e..cb03b4a 100644 --- a/blade-service/blade-log/pom.xml +++ b/blade-service/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index c3d7ac4..35f0799 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index 961c31c..9f4c17c 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.0.0 + 3.0.1 4.0.0 diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 9ffe13f..37f1008 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -7,12 +7,12 @@ org.springblade SpringBlade - 3.0.0 + 3.0.1 blade-service ${project.artifactId} - 3.0.0 + 3.0.1 pom SpringBlade 微服务集合 diff --git a/doc/nacos/blade.yaml b/doc/nacos/blade.yaml index 6f5228b..2ad85be 100644 --- a/doc/nacos/blade.yaml +++ b/doc/nacos/blade.yaml @@ -1,14 +1,16 @@ #服务器配置 server: undertow: - # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 - io-threads: 4 - # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 - worker-threads: 20 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 buffer-size: 1024 # 是否分配的直接内存 direct-buffers: true + # 线程配置 + threads: + # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 + io: 16 + # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 + worker: 400 #spring配置 spring: @@ -59,6 +61,22 @@ knife4j: enableFilterMultipartApis: false enableFilterMultipartApiMethodType: POST language: zh-CN + enableFooter: false + enableFooterCustom: true + footerCustomContent: Copyright © 2021 SpringBlade All Rights Reserved + +#swagger配置信息 +swagger: + title: SpringBlade 接口文档系统 + description: SpringBlade 接口文档系统 + version: 3.0.1 + license: Powered By SpringBlade + licenseUrl: https://bladex.vip + terms-of-service-url: https://bladex.vip + contact: + name: smallchill + email: smallchill@163.com + url: https://gitee.com/smallc #blade配置 blade: diff --git a/doc/sql/blade/blade-update-2.7.3~2.8.0.sql b/doc/sql/blade/blade-update-2.7.3~2.8.0.sql deleted file mode 100644 index 220d7a5..0000000 --- a/doc/sql/blade/blade-update-2.7.3~2.8.0.sql +++ /dev/null @@ -1,32 +0,0 @@ --- ---------------------------- --- 报表文件表 --- ---------------------------- -CREATE TABLE `blade_report_file` ( - `id` bigint(64) NOT NULL COMMENT '主键', - `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件名', - `content` mediumblob NULL COMMENT '文件内容', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `is_deleted` int(2) NULL DEFAULT 0 COMMENT '是否已删除', - PRIMARY KEY (`id`) -) COMMENT = '报表文件表'; - --- ---------------------------- --- 插入报表文件表菜单数据 --- ---------------------------- -INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) -VALUES ('1164733399669962301', '0', 'report', '报表管理', 'menu', '/report', 'iconfont icon-shujuzhanshi2', 5, 1, 0, 1, NULL, 0); -INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) -VALUES ('1164733399669962302', '1164733399669962301', 'report_setting', '报表配置', 'menu', 'http://localhost:8108/ureport/designer', 'iconfont icon-rizhi', 1, 1, 0, 1, NULL, 0); -INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) -VALUES ('1164733399669962303', '1164733399669962301', 'report_list', '报表列表', 'menu', '/report/reportlist', 'iconfont icon-biaodan', 2, 1, 0, 1, NULL, 0); - --- ---------------------------- --- 增加报表文件表菜单权限数据 --- ---------------------------- -INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) -VALUES ('1161272893875228001', '1164733399669962301', '1123598816738675201'); -INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) -VALUES ('1161272893875228002', '1164733399669962302', '1123598816738675201'); -INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) -VALUES ('1161272893875228003', '1164733399669962303', '1123598816738675201'); diff --git a/pom.xml b/pom.xml index a99cd44..11bd881 100644 --- a/pom.xml +++ b/pom.xml @@ -5,30 +5,28 @@ org.springblade SpringBlade - 3.0.0 + 3.0.1 pom - 3.0.0 - 3.0.0 + 3.0.1 + 3.0.1 1.8 3.8.1 2.10.5 1.6.2 - 2.2.0.RELEASE - 2.0.6 - 3.4.0 + 2.0.8 1.6.0 1.6.2 2.2.6 1.2.5 - 2.2.3.RELEASE + 2.2.5.RC2 2.3.1 2.0.0.RELEASE - 2.4.1 - 2020.0.0 + 2.4.2 + 2020.0.1 Cairo-SR8 diff --git a/script/docker/.env b/script/docker/.env index fbe046c..380d264 100644 --- a/script/docker/.env +++ b/script/docker/.env @@ -1,2 +1,2 @@ REGISTER=192.168.0.157/blade -TAG=3.0.0 +TAG=3.0.1 diff --git a/script/docker/deploy.sh b/script/docker/deploy.sh index e5e1354..a322250 100644 --- a/script/docker/deploy.sh +++ b/script/docker/deploy.sh @@ -15,6 +15,7 @@ port(){ firewall-cmd --add-port=3379/tcp --permanent firewall-cmd --add-port=7002/tcp --permanent firewall-cmd --add-port=9411/tcp --permanent + firewall-cmd --add-port=18000/tcp --permanent service firewalld restart } @@ -42,7 +43,7 @@ base(){ #启动程序模块 modules(){ - docker-compose up -d blade-gateway1 blade-gateway2 blade-admin blade-auth1 blade-auth2 blade-user blade-desk blade-system blade-log + docker-compose up -d blade-gateway1 blade-gateway2 blade-admin blade-swagger blade-auth1 blade-auth2 blade-user blade-desk blade-system blade-log blade-report } #关闭所有模块 diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml index c0e40d0..31d7856 100644 --- a/script/docker/docker-compose.yml +++ b/script/docker/docker-compose.yml @@ -71,6 +71,15 @@ services: networks: - blade_net + blade-swagger: + image: "${REGISTER}/blade/blade-swagger:${TAG}" + ports: + - 18000:18000 + privileged: true + restart: always + networks: + - blade_net + blade-gateway1: image: "${REGISTER}/blade/blade-gateway:${TAG}" privileged: true