From 311afd431baf1734aaf0c00d0a58646efd075061 Mon Sep 17 00:00:00 2001 From: LamGC Date: Sun, 8 Nov 2020 18:39:30 +0800 Subject: [PATCH] =?UTF-8?q?[Add]=20Framework-API=20=E4=B8=BA=20MessageSend?= =?UTF-8?q?er=20=E6=B7=BB=E5=8A=A0=20getPlatform=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BB=A5=E6=9B=B4=E5=A5=BD=E7=9A=84=E6=A0=87=E8=AF=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=20Sender,=20=E5=B9=B6=E4=B8=94=E8=A1=A5=E5=85=85=20Ja?= =?UTF-8?q?vadoc;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Add] MessageSender 添加 'getPlatform()' 方法以获取识别 Sender 的其中一个要素, 补充类文档; --- .../bot/framework/message/MessageSender.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/MessageSender.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/MessageSender.java index 95d3932..cd6ba61 100644 --- a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/MessageSender.java +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/MessageSender.java @@ -17,6 +17,7 @@ package net.lamgc.cgj.bot.framework.message; +import net.lamgc.cgj.bot.framework.Platform; import net.lamgc.cgj.bot.framework.message.exception.UploadImageException; import java.io.File; @@ -25,10 +26,31 @@ import java.io.IOException; import java.io.InputStream; /** + * 消息发送者. + *

可通过该对象回复发送者, 或是获取来自该发送者消息中, + * 通过消息内 {@link BotCode} 解析而来的消息资源(例如图片, 视频, 语音, 文件等). + *

发送者的识别依靠三个要素: + *

+ * 三个要素全部符合即为同一个联系人, 有以下情况: + * * @author LamGC */ public interface MessageSender { + /** + * 获取平台信息. + * @return 返回平台信息. + */ + Platform getPlatform(); + /** * 获取消息源类型. * @return 返回消息源类型, 不允许返回 null.