yangys
2024-05-10 e723f28d33de6348849e90352d56f7a600e62456
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.qianwen.core.swagger;
 
import com.qianwen.core.launch.props.BladePropertySource;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
@EnableConfigurationProperties({SwaggerProperties.class})
@Configuration(proxyBeanMethods = false)
@BladePropertySource("classpath:/blade-swagger.yml")
public class SwaggerWebConfiguration implements WebMvcConfigurer {
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(new String[]{"doc.html"}).addResourceLocations(new String[]{"classpath:/META-INF/resources/"});
        registry.addResourceHandler(new String[]{"/webjars/**"}).addResourceLocations(new String[]{"classpath:/META-INF/resources/webjars/"});
    }
}