mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 22:27:33 +00:00
[Add] Framework-API 为 MessageSender 添加 getPlatform 方法以更好的标识一个 Sender, 并且补充 Javadoc;
[Add] MessageSender 添加 'getPlatform()' 方法以获取识别 Sender 的其中一个要素, 补充类文档;
This commit is contained in:
parent
f01d1ac8fd
commit
311afd431b
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package net.lamgc.cgj.bot.framework.message;
|
package net.lamgc.cgj.bot.framework.message;
|
||||||
|
|
||||||
|
import net.lamgc.cgj.bot.framework.Platform;
|
||||||
import net.lamgc.cgj.bot.framework.message.exception.UploadImageException;
|
import net.lamgc.cgj.bot.framework.message.exception.UploadImageException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -25,10 +26,31 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 消息发送者.
|
||||||
|
* <p> 可通过该对象回复发送者, 或是获取来自该发送者消息中,
|
||||||
|
* 通过消息内 {@link BotCode} 解析而来的消息资源(例如图片, 视频, 语音, 文件等).
|
||||||
|
* <p>发送者的识别依靠三个要素:
|
||||||
|
* <ul>
|
||||||
|
* <li> {@link Platform}
|
||||||
|
* <li> {@link MessageSource}
|
||||||
|
* <li> {@link #getId() SenderId}
|
||||||
|
* </ul>
|
||||||
|
* 三个要素全部符合即为同一个联系人, 有以下情况:
|
||||||
|
* <ul>
|
||||||
|
* <li> Platform 相同, MessageSource 相同, 则 SenderId 不允许相同;
|
||||||
|
* <li> Platform 相同, SenderId 相同, 则 MessageSender 不允许相同;
|
||||||
|
* <li> MessageSender 相同, SenderId 相同, 则 Platform 不允许相同;
|
||||||
|
* </ul>
|
||||||
* @author LamGC
|
* @author LamGC
|
||||||
*/
|
*/
|
||||||
public interface MessageSender {
|
public interface MessageSender {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取平台信息.
|
||||||
|
* @return 返回平台信息.
|
||||||
|
*/
|
||||||
|
Platform getPlatform();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取消息源类型.
|
* 获取消息源类型.
|
||||||
* @return 返回消息源类型, 不允许返回 null.
|
* @return 返回消息源类型, 不允许返回 null.
|
||||||
|
Loading…
Reference in New Issue
Block a user