From 859a425566a1f7ee6ddf4bcc68437dd5883c2f80 Mon Sep 17 00:00:00 2001 From: wangqing <408564126@qq.com> Date: Fri, 8 Mar 2024 22:28:17 +0800 Subject: [PATCH] fix: comment replyToName error --- .../comment/sensitiveword/MyDdWordAllow.java | 21 ------------ .../comment/sensitiveword/MyDdWordDeny.java | 33 ------------------- .../sensitiveword/SensitiveWordService.java | 16 --------- 3 files changed, 70 deletions(-) delete mode 100644 luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordAllow.java delete mode 100644 luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordDeny.java delete mode 100644 luoo_comment/src/main/java/com/luoo/comment/sensitiveword/SensitiveWordService.java diff --git a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordAllow.java b/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordAllow.java deleted file mode 100644 index 135f170..0000000 --- a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordAllow.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.luoo.comment.sensitiveword; - -import com.github.houbb.sensitive.word.api.IWordAllow; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; - -@Component -public class MyDdWordAllow implements IWordAllow { - - @Override - public List allow() { - List list = new ArrayList<>(); - list.add("五星红旗"); - list.add("天安门"); - - return list; - } - -} diff --git a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordDeny.java b/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordDeny.java deleted file mode 100644 index c2f63aa..0000000 --- a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/MyDdWordDeny.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.luoo.comment.sensitiveword; - -import com.github.houbb.sensitive.word.api.IWordDeny; -import constants.SensitiveWords; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.Resource; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; - -@Component -public class MyDdWordDeny implements IWordDeny { - - String DENY_WORDS= SensitiveWords.DENY_WORDS; - @Override - public List deny() { - List list = new ArrayList<>(); -// list.add("落网"); - - String[] s = DENY_WORDS.split("\n"); - for(String denyWord:s) { - list.add(denyWord); - } - - return list; - } -} \ No newline at end of file diff --git a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/SensitiveWordService.java b/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/SensitiveWordService.java deleted file mode 100644 index a103c3a..0000000 --- a/luoo_comment/src/main/java/com/luoo/comment/sensitiveword/SensitiveWordService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.luoo.comment.sensitiveword; - -import com.github.houbb.sensitive.word.bs.SensitiveWordBs; -import org.springframework.beans.factory.annotation.Autowired; - -public class SensitiveWordService { - - @Autowired - private SensitiveWordBs sensitiveWordBs; - - - public void refresh() { - // 每次数据库的信息发生变化之后,首先调用更新数据库敏感词库的方法,然后调用这个方法。 - sensitiveWordBs.init(); - } -} \ No newline at end of file