...
|
...
|
@@ -4,6 +4,7 @@ import com.yoho.message.dal.MessageSensitiveWordsMapper; |
|
|
import com.yoho.yhmessage.filter.IFilterSensitiveWordService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -189,4 +190,19 @@ public class FilterSensitiveWordServiceImpl implements IFilterSensitiveWordServi |
|
|
Matcher m = p.matcher(str);
|
|
|
return m.find();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 检查是否包含测试相关字眼
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean checkTestWord(String content){
|
|
|
if (StringUtils.isNotBlank(content)) {
|
|
|
content = content.trim();
|
|
|
return content.equals("测试") || "test".equals(content.toLowerCase());
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|