mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 00:17:35 +08:00
[Feature] add for new
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -1,31 +1,4 @@
|
|||||||
# 多收件人的概念
|
# 包含
|
||||||
|
|
||||||
## 收件人
|
|
||||||
|
|
||||||
## 抄送者
|
# filter
|
||||||
|
|
||||||
## 秘密抄送者
|
|
||||||
|
|
||||||
# 池化
|
|
||||||
|
|
||||||
## 发件人
|
|
||||||
|
|
||||||
类似于线程池,可以设置池化的概念。
|
|
||||||
|
|
||||||
## 发送的性能
|
|
||||||
|
|
||||||
发送时多线程支持。
|
|
||||||
|
|
||||||
# 常见其他邮箱支持
|
|
||||||
|
|
||||||
## 网易
|
|
||||||
|
|
||||||
## QQ
|
|
||||||
|
|
||||||
## gmail
|
|
||||||
|
|
||||||
qq gmail xxx
|
|
||||||
|
|
||||||
# 对于模板的支持
|
|
||||||
|
|
||||||
FTL 模板的支持。
|
|
||||||
2
doc/issues/v2-基本敏感词的标签.md
Normal file
2
doc/issues/v2-基本敏感词的标签.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
一个词可以有多个标签。
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# 常见其他邮箱支持
|
|
||||||
|
|
||||||
## 网易
|
|
||||||
|
|
||||||
## QQ
|
|
||||||
|
|
||||||
## gmail
|
|
||||||
|
|
||||||
## 自定义
|
|
||||||
|
|
||||||
允许用户自定义属性配置。
|
|
||||||
|
|
||||||
- 可以提供常见的常量 key+value,优化使用体验。
|
|
||||||
|
|
||||||
- 提供默认邮件配置模板
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# 对于模板的支持
|
|
||||||
|
|
||||||
FTL 模板的支持。
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# 池化
|
|
||||||
|
|
||||||
## 发件人
|
|
||||||
|
|
||||||
类似于线程池,可以设置池化的概念。
|
|
||||||
|
|
||||||
## 发送的性能
|
|
||||||
|
|
||||||
发送时多线程支持。
|
|
||||||
。
|
|
||||||
21
pom.xml
21
pom.xml
@@ -25,9 +25,8 @@
|
|||||||
<project.compiler.level>1.7</project.compiler.level>
|
<project.compiler.level>1.7</project.compiler.level>
|
||||||
|
|
||||||
<!--============================== INTER ==============================-->
|
<!--============================== INTER ==============================-->
|
||||||
|
<heaven.version>0.1.66</heaven.version>
|
||||||
<!--============================== OTHER ==============================-->
|
<!--============================== OTHER ==============================-->
|
||||||
<javax.mail.version>1.6.2</javax.mail.version>
|
|
||||||
<junit.version>4.12</junit.version>
|
<junit.version>4.12</junit.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -36,13 +35,13 @@
|
|||||||
<!--============================== SELF ==============================-->
|
<!--============================== SELF ==============================-->
|
||||||
|
|
||||||
<!--============================== INTER ==============================-->
|
<!--============================== INTER ==============================-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.houbb</groupId>
|
||||||
|
<artifactId>heaven</artifactId>
|
||||||
|
<version>${heaven.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--============================== OTHER ==============================-->
|
<!--============================== OTHER ==============================-->
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.mail</groupId>
|
|
||||||
<artifactId>javax.mail</artifactId>
|
|
||||||
<version>${javax.mail.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
@@ -59,6 +58,10 @@
|
|||||||
<!--============================== SELF ==============================-->
|
<!--============================== SELF ==============================-->
|
||||||
|
|
||||||
<!--============================== INTER ==============================-->
|
<!--============================== INTER ==============================-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.houbb</groupId>
|
||||||
|
<artifactId>heaven</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--============================== OTHER ==============================-->
|
<!--============================== OTHER ==============================-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -66,10 +69,6 @@
|
|||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.mail</groupId>
|
|
||||||
<artifactId>javax.mail</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* api 定义
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
package com.github.houbb.sensitive.word.api;
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package com.github.houbb.sensitive.word.bs;
|
||||||
|
|
||||||
|
import com.github.houbb.heaven.util.lang.StringUtil;
|
||||||
|
import com.github.houbb.heaven.util.util.CollectionUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感词引导类
|
||||||
|
* @author binbin.hou
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public class SensitiveWordBs {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 私有化构造器
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
private SensitiveWordBs(){}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待验证字符串信息
|
||||||
|
* ps: 可以添加多个辅助类 xxxStringProvider
|
||||||
|
* 如 FileXXX
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
private volatile String target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建验证实例
|
||||||
|
* @param string 字符串
|
||||||
|
* @return this
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public static SensitiveWordBs newInstance(final String string) {
|
||||||
|
SensitiveWordBs instance = new SensitiveWordBs();
|
||||||
|
instance.target = string;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定目标字符串信息
|
||||||
|
* @param string 字符串
|
||||||
|
* @return this
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public SensitiveWordBs target(final String string) {
|
||||||
|
this.target = string;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合法
|
||||||
|
* @return 是否
|
||||||
|
* @since 0.0.1
|
||||||
|
* @see #contains() 是否包含
|
||||||
|
*/
|
||||||
|
public boolean valid() {
|
||||||
|
return !contains();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否包含敏感词
|
||||||
|
* @return 是否
|
||||||
|
* @since 0.0.1
|
||||||
|
* @see #findAll() 列表不为空即可
|
||||||
|
*/
|
||||||
|
public boolean contains() {
|
||||||
|
return CollectionUtil.isNotEmpty(findAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回所有的敏感词
|
||||||
|
* 1. 这里是默认去重的。
|
||||||
|
* @return 敏感词列表
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public List<String> findAll() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行过滤
|
||||||
|
* 1. 使用默认策略
|
||||||
|
* 2. 默认策略就是直接移除。
|
||||||
|
* @return 过滤后的结果
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public String filter() {
|
||||||
|
return filter(StringUtil.EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定过滤的字符,执行过滤
|
||||||
|
* 1. filter 只是一种特殊的字符串替换策略。
|
||||||
|
* @return 过滤后的结果
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
public String filter(final String filter) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* 引导类定义
|
||||||
|
* @since 0.0.1
|
||||||
|
*/
|
||||||
|
package com.github.houbb.sensitive.word.bs;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.github.houbb.sensitive.word;
|
||||||
Reference in New Issue
Block a user