package com.friday.custody.config;

import com.friday.custody.interceptor.ApiInterceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    public static final String INTERCEPT_URL = "/custody/tranfer/**";

    public static final String QUARTZ_URL = "/custody/quartz/job/**";

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //addPathPatterns拦截的路径
        String[] addPathPatterns = {
                INTERCEPT_URL,
                QUARTZ_URL
        };

        //中转项目验证过滤
        registry.addInterceptor(new ApiInterceptor()).addPathPatterns(addPathPatterns);
    }
}

