diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/doc/issues/issues.md b/doc/issues/issues.md index a1d8187..ea49530 100644 --- a/doc/issues/issues.md +++ b/doc/issues/issues.md @@ -1,31 +1,4 @@ -# 多收件人的概念 +# 包含 -## 收件人 -## 抄送者 - -## 秘密抄送者 - -# 池化 - -## 发件人 - -类似于线程池,可以设置池化的概念。 - -## 发送的性能 - -发送时多线程支持。 - -# 常见其他邮箱支持 - -## 网易 - -## QQ - -## gmail - -qq gmail xxx - -# 对于模板的支持 - -FTL 模板的支持。 \ No newline at end of file +# filter \ No newline at end of file diff --git a/doc/issues/v6-邮件发送的多线程处理.md b/doc/issues/v1-基本敏感词的去重.md similarity index 100% rename from doc/issues/v6-邮件发送的多线程处理.md rename to doc/issues/v1-基本敏感词的去重.md diff --git a/doc/issues/v2-基本敏感词的标签.md b/doc/issues/v2-基本敏感词的标签.md new file mode 100644 index 0000000..3681cfd --- /dev/null +++ b/doc/issues/v2-基本敏感词的标签.md @@ -0,0 +1,2 @@ +一个词可以有多个标签。 + diff --git a/doc/issues/v3-其他常见邮箱的支持.md b/doc/issues/v3-其他常见邮箱的支持.md deleted file mode 100644 index c777b88..0000000 --- a/doc/issues/v3-其他常见邮箱的支持.md +++ /dev/null @@ -1,15 +0,0 @@ -# 常见其他邮箱支持 - -## 网易 - -## QQ - -## gmail - -## 自定义 - -允许用户自定义属性配置。 - -- 可以提供常见的常量 key+value,优化使用体验。 - -- 提供默认邮件配置模板 \ No newline at end of file diff --git a/doc/issues/v4-针对邮件模板的支持.md b/doc/issues/v4-针对邮件模板的支持.md deleted file mode 100644 index b3972c6..0000000 --- a/doc/issues/v4-针对邮件模板的支持.md +++ /dev/null @@ -1,3 +0,0 @@ -# 对于模板的支持 - -FTL 模板的支持。 \ No newline at end of file diff --git a/doc/issues/v5-针对发件人池化的实现.md b/doc/issues/v5-针对发件人池化的实现.md deleted file mode 100644 index 088cba1..0000000 --- a/doc/issues/v5-针对发件人池化的实现.md +++ /dev/null @@ -1,10 +0,0 @@ -# 池化 - -## 发件人 - -类似于线程池,可以设置池化的概念。 - -## 发送的性能 - -发送时多线程支持。 -。 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 160a97c..fe7808f 100644 --- a/pom.xml +++ b/pom.xml @@ -25,9 +25,8 @@ 1.7 - + 0.1.66 - 1.6.2 4.12 @@ -36,13 +35,13 @@ + + com.github.houbb + heaven + ${heaven.version} + - - com.sun.mail - javax.mail - ${javax.mail.version} - junit @@ -59,6 +58,10 @@ + + com.github.houbb + heaven + @@ -66,10 +69,6 @@ junit - - com.sun.mail - javax.mail - diff --git a/src/main/java/com/github/houbb/sensitive/word/api/package-info.java b/src/main/java/com/github/houbb/sensitive/word/api/package-info.java new file mode 100644 index 0000000..14434b7 --- /dev/null +++ b/src/main/java/com/github/houbb/sensitive/word/api/package-info.java @@ -0,0 +1,5 @@ +/** + * api 定义 + * @since 0.0.1 + */ +package com.github.houbb.sensitive.word.api; \ No newline at end of file diff --git a/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java b/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java new file mode 100644 index 0000000..c7f80bb --- /dev/null +++ b/src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java @@ -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 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 ""; + } + +} diff --git a/src/main/java/com/github/houbb/sensitive/word/bs/package-info.java b/src/main/java/com/github/houbb/sensitive/word/bs/package-info.java new file mode 100644 index 0000000..e6f6053 --- /dev/null +++ b/src/main/java/com/github/houbb/sensitive/word/bs/package-info.java @@ -0,0 +1,5 @@ +/** + * 引导类定义 + * @since 0.0.1 + */ +package com.github.houbb.sensitive.word.bs; \ No newline at end of file diff --git a/src/main/java/com/github/houbb/sensitive/word/package-info.java b/src/main/java/com/github/houbb/sensitive/word/package-info.java new file mode 100644 index 0000000..ce67093 --- /dev/null +++ b/src/main/java/com/github/houbb/sensitive/word/package-info.java @@ -0,0 +1 @@ +package com.github.houbb.sensitive.word; \ No newline at end of file