com.codingapi.springboot.permission.analyzer.SqlAnalyzerConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-starter-data-permission Show documentation
Show all versions of springboot-starter-data-permission Show documentation
springboot-starter-data-permission project for Spring Boot
package com.codingapi.springboot.permission.analyzer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
* @author lorne
* @since 1.0.0
*/
@Configuration
public class SqlAnalyzerConfiguration {
static class SqlAnalyzerFilterBeanInit {
public SqlAnalyzerFilterBeanInit(List filters) {
if(filters!=null&&filters.size()>0) {
AnalyzerFilterContext.getInstance().addFilters(filters);
}
}
}
@Bean
@ConditionalOnMissingBean
public SqlAnalyzerFilterBeanInit sqlAnalyzerFilterInit(@Autowired(required = false) List filters){
return new SqlAnalyzerFilterBeanInit(filters);
}
}