From 5eb254183497b59db6f8821fc4815ff90f0454a3 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Thu, 4 Mar 2021 09:48:40 +0800 Subject: [PATCH] =?UTF-8?q?gateway=E8=AE=BF=E9=97=AE=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=BF=9B=E5=85=A5swagger=E6=96=87=E6=A1=A3=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/config/GatewayRoutersConfiguration.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway/src/main/java/org/jeecg/config/GatewayRoutersConfiguration.java b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway/src/main/java/org/jeecg/config/GatewayRoutersConfiguration.java index 88b95d70..71d4d7c7 100644 --- a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway/src/main/java/org/jeecg/config/GatewayRoutersConfiguration.java +++ b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway/src/main/java/org/jeecg/config/GatewayRoutersConfiguration.java @@ -3,16 +3,20 @@ package org.jeecg.config; import lombok.extern.slf4j.Slf4j; import org.jeecg.handler.HystrixFallbackHandler; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 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; +import org.springframework.web.reactive.function.server.ServerResponse; import javax.annotation.Resource; +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; +import static org.springframework.web.reactive.function.server.ServerResponse.ok; + /** * @author scott * @date 2020/05/26 @@ -74,6 +78,11 @@ public class GatewayRoutersConfiguration { } + @Bean + public RouterFunction indexRouter(@Value("classpath:/META-INF/resources/doc.html") final org.springframework.core.io.Resource indexHtml) { + return route(GET("/"), request -> ok().contentType(MediaType.TEXT_HTML).syncBody(indexHtml)); + } + @Resource private HystrixFallbackHandler hystrixFallbackHandler; -- GitLab