parent
27936e1e5d
commit
94269b86ac
@ -0,0 +1,21 @@
|
||||
package com.luoo.comment.sensitive;
|
||||
|
||||
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<String> allow() {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("五星红旗");
|
||||
list.add("天安门");
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.luoo.comment.sensitive;
|
||||
|
||||
import com.github.houbb.sensitive.word.api.IWordDeny;
|
||||
import constants.SensitiveWords;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MyDdWordDeny implements IWordDeny {
|
||||
String DENY_WORDS= SensitiveWords.DENY_WORDS;
|
||||
@Override
|
||||
public List<String> deny() {
|
||||
List<String> list = new ArrayList<>();
|
||||
// list.add("落网");
|
||||
|
||||
String[] s = DENY_WORDS.split("\n");
|
||||
for(String denyWord:s) {
|
||||
list.add(denyWord);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue