All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iiifi.kite.boot.web.reactive.config.SwaggerAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.2.4.RELEASE
Show newest version
package com.iiifi.kite.boot.web.reactive.config;

import springfox.documentation.spring.web.plugins.Docket;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.reactive.config.ResourceHandlerRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;

/**
 * Swagger 页面静态文件配置
 * @author [email protected] 花朝
 * @date 2018/8/18 12:59
 */
@Configuration
@ConditionalOnClass(Docket.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
@ConditionalOnProperty(value = "kite.swagger.enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingClass("org.springframework.cloud.gateway.configuration.GatewayAutoConfiguration")
public class SwaggerAutoConfiguration implements WebFluxConfigurer {

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/swagger-ui.html")
			.addResourceLocations("classpath:/META-INF/resources/");
		registry.addResourceHandler("/webjars*")
			.addResourceLocations("classpath:/META-INF/resources/webjars/");
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy