敏感词加载继续优化一下,初始化放在consumer中执行
This commit is contained in:
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 初始化敏感词
|
||||
* 敏感词加载
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v1.0
|
||||
@@ -20,13 +20,15 @@ import java.util.List;
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SensitiveInit implements ApplicationRunner {
|
||||
public class SensitiveWordsLoader implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
private Cache<List<String>> cache;
|
||||
|
||||
/**
|
||||
* 程序启动时,获取最新的需要过滤的敏感词
|
||||
* <p>
|
||||
* 这里即便缓存中为空也没关系,定时任务会定时重新加载敏感词
|
||||
*
|
||||
* @param args 启动参数
|
||||
*/
|
||||
Reference in New Issue
Block a user