package com.jeequan.jeepay.core.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<URIFilter> customFilter() {
        FilterRegistrationBean<URIFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new URIFilter());
        registrationBean.addUrlPatterns("/*"); // 设置要过滤的 URL 模式
        registrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE); // 设置为最高优先级
        return registrationBean;
    }
}
