package cn.com.countrygarden.bi.main.service.impl;

import cn.com.countrygarden.bi.main.util.SensitiveWordFilterUtil;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;

@Service
public class SensitiveWordFilterUtilListener implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        if (event.getApplicationContext().getParent() == null) {//保证只执行一次
            System.out.println("--加载文件");
            SensitiveWordFilterUtil.init(); // 初始化
        }

    }
}
