package ink.wgink.module.file.config;

import ink.wgink.module.file.filter.FilesFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: FileConfig
 * @Description: 文件配置
 * @Author: wanggeng
 * @Date: 2022/8/1 09:48
 * @Version: 1.0
 */
@Configuration
public class FileConfig {

    @Bean
    public FilterRegistrationBean filesFilter() {
        FilesFilter filesFilter = new FilesFilter();
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(filesFilter);
        filterRegistrationBean.addUrlPatterns("/files/*");
        filterRegistrationBean.setName("filesFilter");
        filterRegistrationBean.setOrder(20);
        return filterRegistrationBean;
    }



}
