package com.iqser.red.persistence.service.v1.external.api.impl.interceptors;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import lombok.RequiredArgsConstructor;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Component
@RequiredArgsConstructor
public class DownloadTempFileInterceptorConfig implements WebMvcConfigurer {

    private final DownloadTempFileInterceptor tempFileInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(tempFileInterceptor).addPathPatterns("/async/download/**");
    }

}
