MrShi
2026-04-29 275596fc999e12e2b6f2f0ea1a0ddcc9efdc6567
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.doumee.config.swagger;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
/**
 * Swagger拦截器配置
 * @author  dm
 * @date 2022/04/18 18:12
 */
@Configuration
public class SwaggerInterceptorConfig implements WebMvcConfigurer {
 
    @Autowired
    private SwaggerInterceptor swaggerInterceptor;
 
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(swaggerInterceptor).addPathPatterns("/swagger-ui.html", "/doc.html");
    }
}