21 lines
701 B
Java
21 lines
701 B
Java
|
|
package com.gcsc.guide.config;
|
||
|
|
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import org.springframework.context.annotation.Configuration;
|
||
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||
|
|
|
||
|
|
@Configuration
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||
|
|
|
||
|
|
private final ApiAccessLogInterceptor apiAccessLogInterceptor;
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
||
|
|
registry.addInterceptor(apiAccessLogInterceptor)
|
||
|
|
.addPathPatterns("/api/**")
|
||
|
|
.excludePathPatterns("/api/health", "/api/health/**");
|
||
|
|
}
|
||
|
|
}
|