From 2a9d07e35e5ec475589d6382c5989251b594f7a7 Mon Sep 17 00:00:00 2001 From: xueye Date: Sat, 3 Jul 2021 21:03:46 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cicdi/notify/template/Template.java | 3 +++ .../notify/template/TemplateProperties.java | 16 ++++++++++++---- .../cicdi/notify/template/TemplateProvider.java | 17 +++++++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/notify-core/src/main/java/com/cicdi/notify/template/Template.java b/notify-core/src/main/java/com/cicdi/notify/template/Template.java index 4e69ad9..779bfe9 100644 --- a/notify-core/src/main/java/com/cicdi/notify/template/Template.java +++ b/notify-core/src/main/java/com/cicdi/notify/template/Template.java @@ -1,9 +1,12 @@ package com.cicdi.notify.template; +import com.cicdi.notify.NotifierProvider; + import java.io.Serializable; /** * 通知模板 + *

不同的服务商{@link TemplateProvider},{@link NotifierProvider}需要实现对应的模板

* * @author xueye */ diff --git a/notify-core/src/main/java/com/cicdi/notify/template/TemplateProperties.java b/notify-core/src/main/java/com/cicdi/notify/template/TemplateProperties.java index 222f9da..17ba6a8 100644 --- a/notify-core/src/main/java/com/cicdi/notify/template/TemplateProperties.java +++ b/notify-core/src/main/java/com/cicdi/notify/template/TemplateProperties.java @@ -1,26 +1,33 @@ package com.cicdi.notify.template; +import com.cicdi.notify.NotifierProvider; +import com.cicdi.notify.NotifyType; + import java.io.Serializable; /** - * 模板属性 + * 通知模板配置属性 * * @author xueye */ public class TemplateProperties implements Serializable { /** - * 模板类型 + * 通知模板类型 + * + * @see NotifyType */ private String type; /** - * 模板提供商 + * 通知模板服务商 + * + * @see NotifierProvider */ private String provider; /** - * 模板 + * 通知模板的JSON字符串 */ private String template; @@ -47,4 +54,5 @@ public class TemplateProperties implements Serializable { public void setTemplate(String template) { this.template = template; } + } diff --git a/notify-core/src/main/java/com/cicdi/notify/template/TemplateProvider.java b/notify-core/src/main/java/com/cicdi/notify/template/TemplateProvider.java index 295a49a..3f82c0b 100644 --- a/notify-core/src/main/java/com/cicdi/notify/template/TemplateProvider.java +++ b/notify-core/src/main/java/com/cicdi/notify/template/TemplateProvider.java @@ -1,29 +1,38 @@ package com.cicdi.notify.template; +import com.cicdi.notify.DefaultNotifyType; import com.cicdi.notify.NotifyType; import com.cicdi.notify.Provider; /** - * 模板提供商 + * 通知模板服务商 + *

模板服务商用于生成对应服务商支持的通知模板

* * @author xueye + * @see Template */ public interface TemplateProvider { /** * @return 通知类型 * @see NotifyType + * @see DefaultNotifyType */ NotifyType getType(); /** - * @return 通知提供商 + * 获取模板的服务商 + * + * @return 模板服务商 */ Provider getProvider(); /** - * @param properties 模板属性 - * @return 模板 + * 根据通知模板配置属性生成通知模板 + * + * @param properties 通知模板配置属性 + * @return 通知模板 */ Template createTemplate(TemplateProperties properties); + }