package com.app.filter.platform;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 功能描述：
 *
 * @Author 梁展鹏
 */
@Configuration
public class PlatformFilterRegistrationConfig {

    @Autowired
    private PlatformWebAdminJwtAuthenticationFilter platformWebAdminJwtAuthenticationFilter;

    @Bean
    public FilterRegistrationBean registerLoginCheckFilter() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(platformWebAdminJwtAuthenticationFilter);
        registrationBean.addUrlPatterns("/platform/*", "/admin/*");
        registrationBean.setName("platformWebAdminJwtAuthenticationFilter");
        registrationBean.setOrder(1);
        return registrationBean;
    }

}
