This commit is contained in:
cansnow
2025-12-05 16:10:52 +08:00
parent 29be534f22
commit 69a61178e1
64 changed files with 2575 additions and 1141 deletions
+5
View File
@@ -0,0 +1,5 @@
interface AtUserInfo {
atUserID:string; // at 成员的 ID
groupNickname:string; // at 成员的昵称
}
export default AtUserInfo;
+9
View File
@@ -0,0 +1,9 @@
import GroupHasReadInfo from "./GroupHasReadInfo";
interface AttachedInfoElem {
groupHasReadInfo:GroupHasReadInfo; // 群消息已读信息
isPrivateChat:boolean; // 标识是否为阅后即焚消息,仅支持单聊
burnDuration:number; // 阅后即焚销毁时间, 客户端自行计时, 到达时间后调用 api 删除消息
hasReadTime:number; // 消息已读时间戳
messageEntityList:string[]; // 暂未使用
}
export default AttachedInfoElem ;
+7
View File
@@ -0,0 +1,7 @@
interface CardElem {
userID:string; // 用户 ID
nickname:string; // 昵称
faceURL:string; // 头像
ex:string; // 拓展字段
}
export default CardElem;
+6
View File
@@ -0,0 +1,6 @@
interface CustomElem {
data:string; // 自定义 json string
extension:string; // 拓展信息
description:string; // 描述信息
}
export default CustomElem;
+5
View File
@@ -0,0 +1,5 @@
interface FaceElem {
index:number; // 表情下标,用户端对端自定义内嵌的表情包
data:string; // 其他表情,如 URL 表情直接返回 url
}
export default FaceElem;
+8
View File
@@ -0,0 +1,8 @@
interface FileElem {
uuID:string; // 唯一 ID
filePath:string; // 本地资源地址
fileSize:number; // 大小
fileName:string; // 文件名字
sourceUrl:string; // 文件远程地址
}
export default FileElem;
+6
View File
@@ -0,0 +1,6 @@
interface GroupHasReadInfo {
hasReadUserIDList:string[]; // 已读的用户 ID 列表
hasReadCount:number; // 已读总数
groupMemberCount:number; // 发送此条消息时的群内人数
}
export default GroupHasReadInfo;
+6
View File
@@ -0,0 +1,6 @@
interface LocationElem {
desc:string; // 描述信息
longitude:number; // 经度
latitude:number; // 纬度
}
export default LocationElem;
+7
View File
@@ -0,0 +1,7 @@
import MessageItem from "./MessageItem";
interface MergeElem {
title:string; // 标题
abstractList:string[]; // 摘要列表
multiMessage:MessageItem[]; // 具体选择合并的消息列表
}
export default MergeElem;
+62
View File
@@ -0,0 +1,62 @@
import { SessionType, MessageType, Platform, MessageStatus } from "openim-uniapp-polyfill";
import OfflinePushInfo from "./OfflinePushInfo";
import PictureElem from "./PictureElem";
import SoundElem from "./SoundElem";
import VideoElem from "./VideoElem";
import FileElem from "./FileElem";
import MergeElem from "./MergeElem";
import atTextElem from "./atTextElem";
import LocationElem from "./LocationElem";
import QuoteElem from "./QuoteElem";
import CustomElem from "./CustomElem";
import NotificationElem from "./NotificationElem";
import FaceElem from "./FaceElem";
import AttachedInfoElem from "./AttachedInfoElem";
import TextElem from "./TextElem";
import CardElem from "./CardElem";
import TypingElem from "./TypingElem";
interface MessageItem {
id: number; // 用户 ID
name: string; // 用户名
isAdmin?: boolean; // 可选属性,是否为管理员clientMsgID string 客户端消息唯一 ID,推荐使用
serverMsgID: string; // 服务端消息唯一 ID,内部使用
createTime: number; // 创建时间
sendTime: number; // 发送时间
sessionType: SessionType; // 会话类型
sendID: string; // 发送者 ID
recvID: string; // 接收者 ID,为群聊会话时无需关注
msgFrom: number; // 内部字段
contentType: MessageType; // 消息类型
platformID: Platform; // 平台号
senderNickname: string; // 发送者昵称
senderFaceUrl: string; // 发送者头像
groupID: string; // 群 ID
content: string; // 内部字段
seq: number; // 消息的 seq
isRead: boolean; // 是否已读
status: MessageStatus; // 消息发送状态
attachedInfo?: string; // 内部字段
ex?: string; // 扩展信息
offlinePush?: OfflinePushInfo; // 离线推送详情
pictureElem?: PictureElem;//图片消息详情
soundElem?: SoundElem; // 语音消息详情
videoElem?: VideoElem; // 视频消息详情
fileElem?: FileElem; // 文件消息详情
mergeElem?: MergeElem; // 合并消息详情
atTextElem?: atTextElem; // @消息详情
locationElem?: LocationElem; // 位置消息详情
quoteElem?: QuoteElem; // 引用消息详情
customElem?: CustomElem; // 自定义消息详情
notificationElem?: NotificationElem; // 通知消息详情
faceElem?: FaceElem; // 自定义表情详情
attachedInfoElem?: AttachedInfoElem; // 附加信息详情
textElem?: TextElem; // 文本内容详情
cardElem?: CardElem; // 名片内容详情
advancedTextElem?: string; // 暂未使用
typingElem?: TypingElem; // 正在输入详情
hasReadTime?: number; // 单聊已读时间戳
isReact: boolean; // 暂未使用
isExternalExtensions: boolean; // 暂未使用
};
export default MessageItem;
+4
View File
@@ -0,0 +1,4 @@
interface NotificationElem {
detail:string; // 通知详情json
}
export default NotificationElem;
+9
View File
@@ -0,0 +1,9 @@
interface OfflinePushInfo {
title:string; // 推送标题
desc:string; // 推送描述
iOSPushSound:string; // ios 推送声音文件的名称
iOSBadgeCount:boolean; // ios 是否展示角标
operatorUserID:string; // 操作员用户 ID
ex:string; // 扩展内容
}
export default OfflinePushInfo;
+8
View File
@@ -0,0 +1,8 @@
import PictureInfo from "./PictureInfo";
interface PictureElem {
sourcePath:string; // 本地资源地址
sourcePicture:PictureInfo; // 原图片详情
bigPicture:PictureInfo; // 大图片详情
snapshotPicture:PictureInfo; // 缩略图片详情
}
export default PictureElem;
+9
View File
@@ -0,0 +1,9 @@
interface PictureInfo {
uuID:string; // 唯一 ID
type:string; // 类型
size:number; // 大小
width:number; // 宽度
height:number; // 高度
url:string; // 图片地址
}
export default PictureInfo;
+7
View File
@@ -0,0 +1,7 @@
import MessageItem from "./MessageItem";
interface QuoteElem {
text:string; // 回复的消息内容
quoteMessage:MessageItem; // 被引用的消息
messageEntityList:string[]; // 暂未使用
}
export default QuoteElem;
+8
View File
@@ -0,0 +1,8 @@
interface SoundElem {
uuID:string; // 唯一 ID
soundPath:string; // 本地资源地址
dataSize:number; // 大小
duration:number; // 时长
sourceUrl:string; // 语音远程地址
}
export default SoundElem;
+4
View File
@@ -0,0 +1,4 @@
interface TextElem {
content:string; // 文字消息
}
export default TextElem;
+4
View File
@@ -0,0 +1,4 @@
interface TypingElem {
msgTips:string; // 提示
}
export default TypingElem;
+15
View File
@@ -0,0 +1,15 @@
interface VideoElem {
videoUUID:string; // 唯一 ID
videoPath:string; // 本地资源地址
videoType:string; // 资源类型
videoSize:number; // 大小
duration:number; // 时长
videoUrl:string; // 图片地址
snapshotUUID:string; // 唯一 ID
snapshotPath:string; // 类型
snapshotSize:number; // 大小
snapshotWidth:number; // 宽度
snapshotHeight:number; // 高度
snapshotUrl:string; // 视频缩略图地址
}
export default VideoElem;
+10
View File
@@ -0,0 +1,10 @@
import AtUserInfo from "./AtUserInfo";
import MessageItem from "./MessageItem";
interface atTextElem {
text:string; // 消息内容
atUserList:string[]; // 被@的用户 userID 列表
atUsersInfo:AtUserInfo[]; // 被@的用户信息列表
quoteMessage:MessageItem; // 引用消息
isAtSelf:boolean; // 自己是否被@了
}
export default atTextElem;
+15
View File
@@ -0,0 +1,15 @@
export * from "./atTextElem";
export * from "./AtUserInfo";
export * from "./CardElem";
export * from "./CustomElem";
export * from "./FileElem";
export * from "./LocationElem";
export * from "./MergeElem";
export * from "./MessageItem";
export * from "./NotificationElem";
export * from "./OfflinePushInfo";
export * from "./PictureElem";
export * from "./SoundElem";
export * from "./TextElem";
export * from "./TypingElem";
export * from "./VideoElem";