From 4994e38347f69fd0eabe72984f6c4b8274c694ba Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 17 May 2019 22:23:46 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=20=E4=BC=98=E5=8C=96=E8=81=9A=E5=90=88?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/provider/SwaggerProvider.java | 10 +++++----- blade-gateway/src/main/resources/bootstrap.yml | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) 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 index 1e01a209a..a6031b20a 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java @@ -45,15 +45,15 @@ public class SwaggerProvider implements SwaggerResourcesProvider { public List get() { List resources = new ArrayList<>(); List routeResources = routeProperties.getResources(); - routeResources.forEach(routeResource -> resources.add(swaggerResource(routeResource.getName(), routeResource.getLocation(), routeResource.getVersion()))); + routeResources.forEach(routeResource -> resources.add(swaggerResource(routeResource))); return resources; } - private SwaggerResource swaggerResource(String name, String location, String version) { + private SwaggerResource swaggerResource(RouteResource routeResource) { SwaggerResource swaggerResource = new SwaggerResource(); - swaggerResource.setName(name); - swaggerResource.setLocation(location.concat(API_URI)); - swaggerResource.setSwaggerVersion(version); + 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 a46d9b00b..83fb8145c 100644 --- a/blade-gateway/src/main/resources/bootstrap.yml +++ b/blade-gateway/src/main/resources/bootstrap.yml @@ -1,13 +1,6 @@ server: port: 80 -# 聚合文档配置 -blade: - document: - resources: - - name: 演示模块 - location: /blade-demo - spring: cloud: gateway: @@ -18,3 +11,9 @@ spring: retry: enabled: true +# 聚合文档配置 +blade: + document: + resources: + - name: 演示模块 + location: /blade-demo