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