다운로드 호출 로그관리 작업
This commit is contained in:
@@ -10,11 +10,18 @@ import org.locationtech.jts.geom.Polygon;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
private final FileDownloadInteceptor fileDownloadInteceptor;
|
||||
|
||||
public WebConfig(FileDownloadInteceptor fileDownloadInteceptor) {
|
||||
this.fileDownloadInteceptor = fileDownloadInteceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ObjectMapper objectMapper() {
|
||||
SimpleModule module = new SimpleModule();
|
||||
@@ -29,4 +36,11 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
return Jackson2ObjectMapperBuilder.json().modulesToInstall(module).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry
|
||||
.addInterceptor(fileDownloadInteceptor)
|
||||
.addPathPatterns("/api/inference/download/**"); // 추론 파일 다운로드 API만 //TODO 추후 추가
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user