Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能建议] 一些参数可以动态配置,比如动态配置一些参数,不需要重新初始化引导类 #44

Open
nn200433 opened this issue Jan 31, 2024 · 0 comments

Comments

@nn200433
Copy link

@Lazy
@Bean
public SensitiveWordBs sensitiveWordBs(IWordAllow myWordAllow, IWordDeny myWordDeny) {
    return SensitiveWordBs.newInstance()
            .wordAllow(WordAllows.chains(WordAllows.defaults(), myWordAllow))
            .wordDeny(WordDenys.chains(WordDenys.defaults(), myWordDeny))
            .charIgnore(SensitiveWordCharIgnores.specialChars())
            .init();
}

上方初始化后(已经调用数据库保存的敏感词),想要执行 wordReplace(WordReplaces.chars(symbol)) 方法,动态修改替换策略。
发现替换策略使用的是 final IWordReplace replace = context.wordReplace(); 获取的。然而 context 却要依赖 init() 方法初始化。

image

那么意味着,不同的策略就要有多个引导类。这操作很反常!!!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant