open 3.0
This commit is contained in:
@@ -20,6 +20,7 @@ export 'src/listener/listener_for_service.dart';
|
||||
export 'src/listener/message_kv_info_listener.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/organization_listener.dart';
|
||||
export 'src/listener/put_file_listener.dart';
|
||||
export 'src/listener/signaling_listener.dart';
|
||||
export 'src/listener/user_listener.dart';
|
||||
export 'src/listener/workmoments_listener.dart';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/// 群成员角色
|
||||
class GroupRoleLevel {
|
||||
/// 普通成员
|
||||
static const member = 1;
|
||||
|
||||
/// 群主
|
||||
static const owner = 2;
|
||||
static const owner = 100;
|
||||
|
||||
/// 管理员
|
||||
static const admin = 3;
|
||||
static const admin = 60;
|
||||
|
||||
/// 普通成员
|
||||
static const member = 20;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,5 @@ class ListenerType {
|
||||
static const customBusinessListener = "customBusinessListener";
|
||||
static const messageKvInfoListener = "messageKvInfoListener";
|
||||
static const listenerForService = "listenerForService";
|
||||
static const putFileListener = "putFileListener";
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ class MessageType {
|
||||
/// 自定义
|
||||
static const custom = 110;
|
||||
|
||||
/// 撤回
|
||||
static const revoke = 111;
|
||||
|
||||
/// 已读回执
|
||||
static const has_read_receipt = 112;
|
||||
|
||||
@@ -51,9 +48,6 @@ class MessageType {
|
||||
/// 富文本消息
|
||||
static const advancedText = 117;
|
||||
|
||||
/// 高级撤回
|
||||
static const advancedRevoke = 118;
|
||||
|
||||
static const customMsgNotTriggerConversation = 119;
|
||||
|
||||
static const customMsgOnlineOnly = 120;
|
||||
@@ -154,6 +148,12 @@ class MessageType {
|
||||
/// 群成员信息改变
|
||||
static const groupMemberInfoChangedNotification = 1516;
|
||||
|
||||
/// 群公告修改
|
||||
static const groupNoticeChangedNotification = 1519;
|
||||
|
||||
/// 群名字修改
|
||||
static const groupNameChangedNotification = 1520;
|
||||
|
||||
static const signalingNotificationBegin = 1600;
|
||||
|
||||
/// 信令
|
||||
@@ -165,4 +165,7 @@ class MessageType {
|
||||
static const burnAfterReadingNotification = 1701;
|
||||
|
||||
static const notificationEnd = 2000;
|
||||
|
||||
/// 撤回消息
|
||||
static const revokeMessageNotification = 2101;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/// 消息发送失败
|
||||
class MessageFailedCode {
|
||||
/// 被对方拉黑
|
||||
static const int blockedByFriend = 600;
|
||||
static const int blockedByFriend = 1302;
|
||||
|
||||
/// 被对方删除
|
||||
static const int deletedByFriend = 601;
|
||||
|
||||
/// 已被移除群聊/群已解散
|
||||
static const int notInGroup = 302;
|
||||
static const int notInGroup = 1205;
|
||||
|
||||
}
|
||||
|
||||
/// 添加好友失败
|
||||
class AddFriendFailedCode {
|
||||
/// 该用户已设置不可添加
|
||||
static const int refuseToAddFriends = 10007;
|
||||
static const int refuseToAddFriends = 10013;
|
||||
}
|
||||
|
||||
@@ -2,52 +2,53 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 消息监听
|
||||
class OnAdvancedMsgListener {
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(RevokedInfo info)? onRecvMessageRevokedV2;
|
||||
Function(Message msg)? onMsgDeleted;
|
||||
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
|
||||
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(List<Message> list)? onRecvOfflineNewMessages;
|
||||
|
||||
/// Uniquely identifies
|
||||
String id;
|
||||
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CMessageReadReceipt,
|
||||
this.onRecvGroupMessageReadReceipt,
|
||||
@deprecated this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvMessageRevokedV2,
|
||||
this.onMsgDeleted,
|
||||
this.onNewRecvMessageRevoked,
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvGroupReadReceipt,
|
||||
this.onRecvMessageExtensionsAdded,
|
||||
this.onRecvMessageExtensionsChanged,
|
||||
this.onRecvMessageExtensionsDeleted,
|
||||
this.onRecvMessageExtensionsAdded,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvOfflineNewMessages,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
void msgDeleted(Message msg) {
|
||||
onMsgDeleted?.call(msg);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void newRecvMessageRevoked(RevokedInfo info) {
|
||||
onNewRecvMessageRevoked?.call(info);
|
||||
}
|
||||
|
||||
/// C2C消息已读回执
|
||||
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CMessageReadReceipt?.call(list);
|
||||
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// 群消息已读回执
|
||||
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupMessageReadReceipt?.call(list);
|
||||
void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void recvMessageRevoked(String msgId) {
|
||||
onRecvMessageRevoked?.call(msgId);
|
||||
}
|
||||
|
||||
/// 收到了一条新消息
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void recvMessageRevokedV2(RevokedInfo info) {
|
||||
onRecvMessageRevokedV2?.call(info);
|
||||
/// 收到拓展消息kv新增
|
||||
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
|
||||
onRecvMessageExtensionsAdded?.call(msgID, list);
|
||||
}
|
||||
|
||||
/// 收到拓展消息kv改变
|
||||
@@ -61,8 +62,12 @@ class OnAdvancedMsgListener {
|
||||
onRecvMessageExtensionsDeleted?.call(msgID, list);
|
||||
}
|
||||
|
||||
/// 收到拓展消息kv新增
|
||||
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
|
||||
onRecvMessageExtensionsAdded?.call(msgID, list);
|
||||
/// 收到了一条新消息
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
void recvOfflineNewMessages(List<Message> list) {
|
||||
onRecvOfflineNewMessages?.call(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 好友关系监听
|
||||
class OnFriendshipListener {
|
||||
Function(BlacklistInfo i)? onBlackAdded;
|
||||
Function(BlacklistInfo i)? onBlackDeleted;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationRejected;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendInfo i)? onFriendDeleted;
|
||||
Function(FriendInfo i)? onFriendInfoChanged;
|
||||
Function(BlacklistInfo i)? onBlacklistAdded;
|
||||
Function(BlacklistInfo i)? onBlacklistDeleted;
|
||||
|
||||
OnFriendshipListener({
|
||||
this.onBlacklistAdded,
|
||||
this.onBlacklistDeleted,
|
||||
this.onBlackAdded,
|
||||
this.onBlackDeleted,
|
||||
this.onFriendAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onFriendApplicationAdded,
|
||||
@@ -25,13 +25,13 @@ class OnFriendshipListener {
|
||||
});
|
||||
|
||||
/// 已被加入黑名单
|
||||
void blacklistAdded(BlacklistInfo u) {
|
||||
onBlacklistAdded?.call(u);
|
||||
void blackAdded(BlacklistInfo u) {
|
||||
onBlackAdded?.call(u);
|
||||
}
|
||||
|
||||
/// 已从黑名单移除
|
||||
void blacklistDeleted(BlacklistInfo u) {
|
||||
onBlacklistDeleted?.call(u);
|
||||
void blackDeleted(BlacklistInfo u) {
|
||||
onBlackDeleted?.call(u);
|
||||
}
|
||||
|
||||
/// 好友已添加
|
||||
|
||||
@@ -6,6 +6,7 @@ class OnGroupListener {
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationRejected;
|
||||
Function(GroupInfo info)? onGroupDismissed;
|
||||
Function(GroupInfo info)? onGroupInfoChanged;
|
||||
Function(GroupMembersInfo info)? onGroupMemberAdded;
|
||||
Function(GroupMembersInfo info)? onGroupMemberDeleted;
|
||||
@@ -18,6 +19,7 @@ class OnGroupListener {
|
||||
this.onGroupApplicationAdded,
|
||||
this.onGroupApplicationDeleted,
|
||||
this.onGroupApplicationRejected,
|
||||
this.onGroupDismissed,
|
||||
this.onGroupInfoChanged,
|
||||
this.onGroupMemberAdded,
|
||||
this.onGroupMemberDeleted,
|
||||
@@ -46,6 +48,10 @@ class OnGroupListener {
|
||||
onGroupApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void groupDismissed(GroupInfo info) {
|
||||
onGroupDismissed?.call(info);
|
||||
}
|
||||
|
||||
/// 群资料发生改变
|
||||
void groupInfoChanged(GroupInfo info) {
|
||||
onGroupInfoChanged?.call(info);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/// 组织架构监听
|
||||
class OnOrganizationListener {
|
||||
Function()? onOrganizationUpdated;
|
||||
|
||||
OnOrganizationListener({this.onOrganizationUpdated});
|
||||
|
||||
/// 组织架构有更新
|
||||
void organizationUpdated() {
|
||||
onOrganizationUpdated?.call();
|
||||
}
|
||||
}
|
||||
// /// 组织架构监听
|
||||
// class OnOrganizationListener {
|
||||
// Function()? onOrganizationUpdated;
|
||||
//
|
||||
// OnOrganizationListener({this.onOrganizationUpdated});
|
||||
//
|
||||
// /// 组织架构有更新
|
||||
// void organizationUpdated() {
|
||||
// onOrganizationUpdated?.call();
|
||||
// }
|
||||
// }
|
||||
|
||||
32
lib/src/listener/put_file_listener.dart
Normal file
32
lib/src/listener/put_file_listener.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
class OnPutFileListener {
|
||||
Function(String putID, String hash, int total)? onHashComplete;
|
||||
Function(String putID, int current, int total)? onHashProgress;
|
||||
Function(String putID, int size)? onOpen;
|
||||
Function(String putID, int total, int putType)? onPutComplete;
|
||||
Function(String putID, int save, int current, int total)? onPutProgress;
|
||||
Function(String putID, int current, int total)? onPutStart;
|
||||
|
||||
void hashComplete(String putID, String hash, int total) {
|
||||
onHashComplete?.call(putID, hash, total);
|
||||
}
|
||||
|
||||
void hashProgress(String putID, int current, int total) {
|
||||
onHashProgress?.call(putID, current, total);
|
||||
}
|
||||
|
||||
void open(String putID, int size) {
|
||||
onOpen?.call(putID, size);
|
||||
}
|
||||
|
||||
void putComplete(String putID, int total, int putType) {
|
||||
onPutComplete?.call(putID, total, putType);
|
||||
}
|
||||
|
||||
void putProgress(String putID, int save, int current, int total) {
|
||||
onPutProgress?.call(putID, save, current, total);
|
||||
}
|
||||
|
||||
void putStart(String putID, int current, int total) {
|
||||
onPutStart?.call(putID, current, total);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
/// 朋友圈监听
|
||||
class OnWorkMomentsListener {
|
||||
Function()? onRecvNewNotification;
|
||||
|
||||
OnWorkMomentsListener({this.onRecvNewNotification});
|
||||
|
||||
/// 朋友圈信息发送改变
|
||||
void recvNewNotification() {
|
||||
onRecvNewNotification?.call();
|
||||
}
|
||||
}
|
||||
// /// 朋友圈监听
|
||||
// class OnWorkMomentsListener {
|
||||
// Function()? onRecvNewNotification;
|
||||
//
|
||||
// OnWorkMomentsListener({this.onRecvNewNotification});
|
||||
//
|
||||
// /// 朋友圈信息发送改变
|
||||
// void recvNewNotification() {
|
||||
// onRecvNewNotification?.call();
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
@@ -71,26 +73,13 @@ class ConversationManager {
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getMultipleConversation',
|
||||
_buildParam({
|
||||
"conversationIDList": conversationIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||
|
||||
/// 通过会话id删除指定会话
|
||||
/// [conversationID] 被删除的会话的id
|
||||
Future deleteConversation({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteConversation',
|
||||
'getMultipleConversation',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"conversationIDList": conversationIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||
|
||||
/// 设置会话草稿
|
||||
/// [conversationID] 会话id
|
||||
@@ -124,6 +113,19 @@ class ConversationManager {
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 置顶会话
|
||||
/// [conversationID] 会话id
|
||||
Future hideConversation({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'hideConversation',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取未读消息总数
|
||||
/// int.tryParse(count) ?? 0;
|
||||
Future<dynamic> getTotalUnreadMsgCount({
|
||||
@@ -138,29 +140,29 @@ class ConversationManager {
|
||||
/// 查询会话id
|
||||
/// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<dynamic> getConversationIDBySessionType({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'getConversationIDBySessionType',
|
||||
_buildParam({
|
||||
"sourceID": sourceID,
|
||||
"sessionType": sessionType,
|
||||
}));
|
||||
// Future<dynamic> getConversationIDBySessionType({
|
||||
// required String sourceID,
|
||||
// required int sessionType,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'getConversationIDBySessionType',
|
||||
// _buildParam({
|
||||
// "sourceID": sourceID,
|
||||
// "sessionType": sessionType,
|
||||
// }));
|
||||
|
||||
/// 消息免打扰设置
|
||||
/// [conversationIDList] 会话id列表
|
||||
/// [conversationID] 会话id
|
||||
/// [status] 0:正常;1:不接受消息;2:接受在线消息不接受离线消息;
|
||||
Future<dynamic> setConversationRecvMessageOpt({
|
||||
required List<String> conversationIDList,
|
||||
required String conversationID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationRecvMessageOpt',
|
||||
_buildParam({
|
||||
"conversationIDList": conversationIDList,
|
||||
"conversationID": conversationID,
|
||||
"status": status,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -184,13 +186,13 @@ class ConversationManager {
|
||||
/// 阅后即焚
|
||||
/// [conversationID] 会话id
|
||||
/// [isPrivate] true:开启,false:关闭
|
||||
Future<dynamic> setOneConversationPrivateChat({
|
||||
Future<dynamic> setConversationPrivateChat({
|
||||
required String conversationID,
|
||||
required bool isPrivate,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setOneConversationPrivateChat',
|
||||
'setConversationPrivateChat',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isPrivate": isPrivate,
|
||||
@@ -199,12 +201,25 @@ class ConversationManager {
|
||||
|
||||
/// 删除本地以及服务器的会话
|
||||
/// [conversationID] 会话ID
|
||||
Future<dynamic> deleteConversationFromLocalAndSvr({
|
||||
Future<dynamic> deleteConversationAndDeleteAllMsg({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteConversationFromLocalAndSvr',
|
||||
'deleteConversationAndDeleteAllMsg',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 清空会话里的消息
|
||||
/// [conversationID] 会话ID
|
||||
Future<dynamic> clearConversationAndDeleteAllMsg({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearConversationAndDeleteAllMsg',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
@@ -234,8 +249,14 @@ class ConversationManager {
|
||||
}));
|
||||
|
||||
/// 查询@所有人标识
|
||||
Future<dynamic> getAtAllTag() =>
|
||||
_channel.invokeMethod('getAtAllTag', _buildParam({}));
|
||||
Future<dynamic> getAtAllTag({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'getAtAllTag',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 查询@所有人标识
|
||||
String get atAllTag => 'atAllTag';
|
||||
@@ -256,19 +277,33 @@ class ConversationManager {
|
||||
/// 设置阅后即焚时长
|
||||
/// [conversationID] 会话id
|
||||
/// [burnDuration] 时长s,默认30s
|
||||
Future<dynamic> setOneConversationBurnDuration({
|
||||
Future<dynamic> setConversationBurnDuration({
|
||||
required String conversationID,
|
||||
int burnDuration = 30,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setOneConversationBurnDuration',
|
||||
'setConversationBurnDuration',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"burnDuration": burnDuration,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记消息已读
|
||||
/// [conversationID] 会话ID
|
||||
/// [messageIDList] 被标记的消息clientMsgID
|
||||
Future markConversationMessageAsRead({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markConversationMessageAsRead',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 会话列表自定义排序规则。
|
||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||
..sort((a, b) {
|
||||
@@ -279,23 +314,24 @@ class ConversationManager {
|
||||
: a.latestMsgSendTime!;
|
||||
int bCompare = b.draftTextTime! > b.latestMsgSendTime!
|
||||
? b.draftTextTime!
|
||||
: b.latestMsgSendTime!;
|
||||
if (aCompare > bCompare) {
|
||||
return -1;
|
||||
} else if (aCompare < bCompare) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else if (a.isPinned == true && b.isPinned != true) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
: b.latestMsgSendTime!;
|
||||
if (aCompare > bCompare) {
|
||||
return -1;
|
||||
} else if (aCompare < bCompare) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else if (a.isPinned == true && b.isPinned != true) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "conversationManager";
|
||||
log('param: $param');
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,42 +14,42 @@ class FriendshipManager {
|
||||
}
|
||||
|
||||
/// 查询好友信息
|
||||
/// [uidList] userID集合
|
||||
/// [userIDList] userID集合
|
||||
Future<List<UserInfo>> getFriendsInfo({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getFriendsInfo',
|
||||
_buildParam({
|
||||
"uidList": uidList,
|
||||
"userIDList": userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
|
||||
/// 发送一个好友请求,需要对方调用同意申请才能成为好友。
|
||||
/// [uid] 被邀请的用户ID
|
||||
/// [userID] 被邀请的用户ID
|
||||
/// [reason] 备注说明
|
||||
Future<dynamic> addFriend({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'addFriend',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"reqMsg": reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取别人加我为好友的申请
|
||||
Future<List<FriendApplicationInfo>> getRecvFriendApplicationList(
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getRecvFriendApplicationList',
|
||||
'getFriendApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -57,11 +57,11 @@ class FriendshipManager {
|
||||
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
|
||||
/// 获取我发出的好友申请
|
||||
Future<List<FriendApplicationInfo>> getSendFriendApplicationList(
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSendFriendApplicationList',
|
||||
'getFriendApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -87,31 +87,31 @@ class FriendshipManager {
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// 设置好友备注
|
||||
/// [uid] 好友的userID
|
||||
/// [userID] 好友的userID
|
||||
/// [remark] 好友的备注
|
||||
Future<dynamic> setFriendRemark({
|
||||
required String uid,
|
||||
required String userID,
|
||||
required String remark,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setFriendRemark',
|
||||
_buildParam({
|
||||
'toUserID': uid,
|
||||
'toUserID': userID,
|
||||
'remark': remark,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 加入黑名单
|
||||
/// [uid] 被加入黑名单的好友ID
|
||||
/// [userID] 被加入黑名单的好友ID
|
||||
Future<dynamic> addBlacklist({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'addBlacklist',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -125,75 +125,75 @@ class FriendshipManager {
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
|
||||
/// 从黑名单移除
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
Future<dynamic> removeBlacklist({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'removeBlacklist',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 检查友好关系
|
||||
/// [uidList] userID列表
|
||||
/// [userIDList] userID列表
|
||||
Future<List<FriendshipInfo>> checkFriend({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'checkFriend',
|
||||
_buildParam({
|
||||
'uidList': uidList,
|
||||
'userIDList': userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (v) => FriendshipInfo.fromJson(v)));
|
||||
|
||||
/// 删除好友
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
Future<dynamic> deleteFriend({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteFriend',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 接受好友请求
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
/// [handleMsg]备注说明
|
||||
Future<dynamic> acceptFriendApplication({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'acceptFriendApplication',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"handleMsg": handleMsg,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 拒绝好友请求
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
/// [handleMsg]备注说明
|
||||
Future<dynamic> refuseFriendApplication({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'refuseFriendApplication',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"handleMsg": handleMsg,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
@@ -14,11 +16,11 @@ class GroupManager {
|
||||
}
|
||||
|
||||
/// 邀请进组,直接进组无需同意。
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<GroupInviteResult>> inviteUserToGroup({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -26,21 +28,21 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'inviteUserToGroup',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
'uidList': uidList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
|
||||
/// 移除组成员
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
/// [reason] 备注说明
|
||||
Future<List<GroupInviteResult>> kickGroupMember({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -48,40 +50,40 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'kickGroupMember',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
'uidList': uidList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
|
||||
/// 查询组成员资料
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<GroupMembersInfo>> getGroupMembersInfo({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupMembersInfo',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'uidList': uidList,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
/// 分页获取组成员列表
|
||||
/// [groupId] 群ID
|
||||
/// [filter] 过滤成员 0所有,1普通成员, 2群主,3管理员,4管理员+普通成员
|
||||
/// [groupID] 群ID
|
||||
/// [filter] 过滤成员 0所有,1群主 , 2管理员,3普通成员,4管理员+普通成员 5,群主+管理员
|
||||
/// [offset] 开始下标
|
||||
/// [count] 总数
|
||||
Future<List<GroupMembersInfo>> getGroupMemberList({
|
||||
required String groupId,
|
||||
required String groupID,
|
||||
int filter = 0,
|
||||
int offset = 0,
|
||||
int count = 0,
|
||||
@@ -91,7 +93,7 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'getGroupMemberList',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'filter': filter,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
@@ -101,12 +103,12 @@ class GroupManager {
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
/// 分页获取组成员列表
|
||||
/// [groupId] 群ID
|
||||
/// [filter] 过滤成员 0所有,1普通成员, 2群主,3管理员,4管理员+普通成员
|
||||
/// [groupID] 群ID
|
||||
/// [filter] 过滤成员 0所有,1群主 , 2管理员,3普通成员,4管理员+普通成员 5,群主+管理员
|
||||
/// [offset] 开始下标
|
||||
/// [count] 总数
|
||||
Future<List<dynamic>> getGroupMemberListMap({
|
||||
required String groupId,
|
||||
required String groupID,
|
||||
int filter = 0,
|
||||
int offset = 0,
|
||||
int count = 0,
|
||||
@@ -116,7 +118,7 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'getGroupMemberList',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'filter': filter,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
@@ -143,14 +145,19 @@ class GroupManager {
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// 检查是否已加入组
|
||||
/// [gid] 组ID
|
||||
/// [groupID] 组ID
|
||||
Future<bool> isJoinedGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
getJoinedGroupList(
|
||||
operationID: Utils.checkOperationID(operationID),
|
||||
).then((list) => list.where((e) => e.groupID == gid).length > 0);
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'isJoinGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => value == 'true' ? true : false);
|
||||
|
||||
/// 创建一个组
|
||||
/// [groupName] 群名
|
||||
@@ -161,28 +168,20 @@ class GroupManager {
|
||||
/// [ex] 额外信息
|
||||
/// [list] 初创群成员以及其角色列表[GroupMemberRole]
|
||||
Future<GroupInfo> createGroup({
|
||||
String? groupName,
|
||||
String? notification,
|
||||
String? introduction,
|
||||
String? faceUrl,
|
||||
int? groupType,
|
||||
String? ex,
|
||||
required List<GroupMemberRole> list,
|
||||
required GroupInfo groupInfo,
|
||||
List<String> memberUserIDs = const [],
|
||||
List<String> adminUserIDs = const [],
|
||||
String? ownerUserID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'createGroup',
|
||||
_buildParam({
|
||||
'gInfo': {
|
||||
"groupName": groupName,
|
||||
"notification": notification,
|
||||
"introduction": introduction,
|
||||
"faceURL": faceUrl,
|
||||
"groupType": groupType,
|
||||
"ex": ex,
|
||||
},
|
||||
'memberList': list.map((e) => e.toJson()).toList(),
|
||||
'groupInfo': groupInfo.toJson(),
|
||||
'memberUserIDs': memberUserIDs,
|
||||
'adminUserIDs': adminUserIDs,
|
||||
'ownerUserID': ownerUserID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then(
|
||||
@@ -193,43 +192,48 @@ class GroupManager {
|
||||
/// [groupName] 新的群名
|
||||
/// [notification] 新的公告
|
||||
/// [introduction] 新的群介绍
|
||||
/// [faceUrl] 新的群头像
|
||||
/// [faceURL] 新的群头像
|
||||
/// [ex] 新的额外信息
|
||||
Future<dynamic> setGroupInfo({
|
||||
required String groupID,
|
||||
String? groupName,
|
||||
String? notification,
|
||||
String? introduction,
|
||||
String? faceUrl,
|
||||
String? faceURL,
|
||||
String? ex,
|
||||
int? needVerification,
|
||||
int? lookMemberInfo,
|
||||
int? applyMemberFriend,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupInfo',
|
||||
_buildParam({
|
||||
"gid": groupID,
|
||||
'gInfo': {
|
||||
// "groupID": groupID,
|
||||
'groupInfo': {
|
||||
"groupID": groupID,
|
||||
"groupName": groupName,
|
||||
"notification": notification,
|
||||
"introduction": introduction,
|
||||
"faceURL": faceUrl,
|
||||
"faceURL": faceURL,
|
||||
"ex": ex,
|
||||
'needVerification': needVerification,
|
||||
'lookMemberInfo': lookMemberInfo,
|
||||
'applyMemberFriend': applyMemberFriend,
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 查询组信息
|
||||
/// [gidList] 组ID列表
|
||||
/// [groupIDList] 组ID列表
|
||||
Future<List<GroupInfo>> getGroupsInfo({
|
||||
required List<String> gidList,
|
||||
required List<String> groupIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupsInfo',
|
||||
_buildParam({
|
||||
'gidList': gidList,
|
||||
'groupIDList': groupIDList,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then(
|
||||
@@ -238,7 +242,7 @@ class GroupManager {
|
||||
/// 申请加入组,需要通过管理员/群组同意。
|
||||
/// [joinSource] 2:通过邀请 3:通过搜索 4:通过二维码
|
||||
Future<dynamic> joinGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
int joinSource = 3,
|
||||
@@ -246,7 +250,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'groupID': groupID,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
@@ -254,38 +258,38 @@ class GroupManager {
|
||||
|
||||
/// 退出组
|
||||
Future<dynamic> quitGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'quitGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 转移组拥有者权限
|
||||
/// [gid] 组ID
|
||||
/// [uid] 新拥有者ID
|
||||
/// [groupID] 组ID
|
||||
/// [userID] 新拥有者ID
|
||||
Future<dynamic> transferGroupOwner({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'transferGroupOwner',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 作为群主或者管理员,收到的群成员入群申请
|
||||
Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getRecvGroupApplicationList',
|
||||
'getGroupApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -293,11 +297,11 @@ class GroupManager {
|
||||
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
|
||||
/// 获取自己发出的入群申请记录
|
||||
Future<List<GroupApplicationInfo>> getSendGroupApplicationList(
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSendGroupApplicationList',
|
||||
'getGroupApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -306,39 +310,39 @@ class GroupManager {
|
||||
|
||||
/// 管理员或者群主同意某人进入某群
|
||||
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||
/// [gid] 组id
|
||||
/// [uid] 申请者用户ID
|
||||
/// [groupID] 组id
|
||||
/// [userID] 申请者用户ID
|
||||
Future<dynamic> acceptGroupApplication({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'acceptGroupApplication',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'handleMsg': handleMsg,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 管理员或者群主拒绝某人进入某群
|
||||
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||
/// [gid] 组id
|
||||
/// [uid] 申请者用户ID
|
||||
/// [groupID] 组id
|
||||
/// [userID] 申请者用户ID
|
||||
/// [handleMsg] 说明
|
||||
Future<dynamic> refuseGroupApplication({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'refuseGroupApplication',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'handleMsg': handleMsg,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -352,7 +356,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'dismissGroup',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -367,7 +371,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'groupID': groupID,
|
||||
'mute': mute,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -385,8 +389,8 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMemberMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'uid': userID,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'seconds': seconds,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -404,8 +408,8 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'setGroupMemberNickname',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'uid': userID,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'groupNickname': groupNickname ?? '',
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -633,6 +637,7 @@ class GroupManager {
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
log('param: $param');
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,15 @@ class IMManager {
|
||||
|
||||
// late OfflinePushManager offlinePushManager;
|
||||
late SignalingManager signalingManager;
|
||||
late WorkMomentsManager workMomentsManager;
|
||||
late OrganizationManager organizationManager;
|
||||
|
||||
// late WorkMomentsManager workMomentsManager;
|
||||
// late OrganizationManager organizationManager;
|
||||
|
||||
late OnConnectListener _connectListener;
|
||||
OnListenerForService? _listenerForService;
|
||||
late String uid;
|
||||
late UserInfo uInfo;
|
||||
OnPutFileListener? _putFileListener;
|
||||
late String userID;
|
||||
late UserInfo userInfo;
|
||||
bool isLogined = false;
|
||||
String? token;
|
||||
String? _objectStorage;
|
||||
@@ -34,8 +36,8 @@ class IMManager {
|
||||
userManager = UserManager(_channel);
|
||||
// offlinePushManager = OfflinePushManager(_channel);
|
||||
signalingManager = SignalingManager(_channel);
|
||||
workMomentsManager = WorkMomentsManager(_channel);
|
||||
organizationManager = OrganizationManager(_channel);
|
||||
// workMomentsManager = WorkMomentsManager(_channel);
|
||||
// organizationManager = OrganizationManager(_channel);
|
||||
_addNativeCallback(_channel);
|
||||
}
|
||||
|
||||
@@ -69,8 +71,8 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onSelfInfoUpdated':
|
||||
uInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||
userManager.listener.selfInfoUpdated(uInfo);
|
||||
userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||
userManager.listener.selfInfoUpdated(userInfo);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.groupListener) {
|
||||
@@ -97,6 +99,10 @@ class IMManager {
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationRejected(i);
|
||||
break;
|
||||
case 'onGroupDismissed':
|
||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||
groupManager.listener.groupDismissed(i);
|
||||
break;
|
||||
case 'onGroupInfoChanged':
|
||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||
groupManager.listener.groupInfoChanged(i);
|
||||
@@ -129,52 +135,59 @@ class IMManager {
|
||||
var type = call.arguments['type'];
|
||||
// var id = call.arguments['data']['id'];
|
||||
switch (type) {
|
||||
case 'onRecvNewMessage':
|
||||
var value = call.arguments['data']['newMessage'];
|
||||
case 'onMsgDeleted':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvNewMessage(msg);
|
||||
break;
|
||||
case 'onRecvMessageRevoked':
|
||||
var msgID = call.arguments['data']['revokedMessage'];
|
||||
messageManager.msgListener.recvMessageRevoked(msgID);
|
||||
break;
|
||||
case 'onRecvC2CReadReceipt':
|
||||
var value = call.arguments['data']['c2cMessageReadReceipt'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CMessageReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvGroupReadReceipt':
|
||||
var value = call.arguments['data']['groupMessageReadReceipt'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupMessageReadReceipt(list);
|
||||
messageManager.msgListener.msgDeleted(msg);
|
||||
break;
|
||||
case 'onNewRecvMessageRevoked':
|
||||
var value = call.arguments['data']['revokedMessageV2'];
|
||||
var value = call.arguments['data']['messageRevoked'];
|
||||
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
|
||||
messageManager.msgListener.recvMessageRevokedV2(info);
|
||||
messageManager.msgListener.newRecvMessageRevoked(info);
|
||||
break;
|
||||
case 'onRecvC2CReadReceipt':
|
||||
var value = call.arguments['data']['msgReceiptList'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvGroupReadReceipt':
|
||||
var value = call.arguments['data']['groupMsgReceiptList'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsAdded':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['reactionExtensionList'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsAdded(msgID, list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsChanged':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var value = call.arguments['data']['reactionExtensionList'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsChanged(msgID, list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsDeleted':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var value = call.arguments['data']['reactionExtensionKeyList'];
|
||||
var list = Utils.toList(value, (map) => '$map');
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsDeleted(msgID, list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsAdded':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsAdded(msgID, list);
|
||||
|
||||
case 'onRecvNewMessage':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvNewMessage(msg);
|
||||
break;
|
||||
case 'onRecvOfflineNewMessages':
|
||||
var value = call.arguments['data']['messageList'];
|
||||
final list = Utils.toList(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvOfflineNewMessages(list);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.msgSendProgressListener) {
|
||||
@@ -224,13 +237,17 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
|
||||
switch (type) {
|
||||
case 'onBlacklistAdded':
|
||||
case 'onBlackAdded':
|
||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||
friendshipManager.listener.blacklistAdded(u);
|
||||
friendshipManager.listener.blackAdded(u);
|
||||
break;
|
||||
case 'onBlacklistDeleted':
|
||||
case 'onBlackDeleted':
|
||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||
friendshipManager.listener.blacklistDeleted(u);
|
||||
friendshipManager.listener.blackDeleted(u);
|
||||
break;
|
||||
case 'onFriendAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(
|
||||
@@ -252,18 +269,14 @@ class IMManager {
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationRejected(u);
|
||||
break;
|
||||
case 'onFriendInfoChanged':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendInfoChanged(u);
|
||||
break;
|
||||
case 'onFriendAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendAdded(u);
|
||||
break;
|
||||
case 'onFriendDeleted':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendDeleted(u);
|
||||
break;
|
||||
case 'onFriendInfoChanged':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendInfoChanged(u);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.signalingListener) {
|
||||
String type = call.arguments['type'];
|
||||
@@ -323,7 +336,8 @@ class IMManager {
|
||||
signalingManager.listener.receiveCustomSignal(info);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.workMomentsListener) {
|
||||
}
|
||||
/*else if (call.method == ListenerType.workMomentsListener) {
|
||||
String type = call.arguments['type'];
|
||||
switch (type) {
|
||||
case 'OnRecvNewNotification':
|
||||
@@ -337,7 +351,8 @@ class IMManager {
|
||||
organizationManager.listener.organizationUpdated();
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.customBusinessListener) {
|
||||
}*/
|
||||
else if (call.method == ListenerType.customBusinessListener) {
|
||||
String type = call.arguments['type'];
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
@@ -385,6 +400,47 @@ class IMManager {
|
||||
_listenerForService?.recvNewMessage(msg);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.putFileListener) {
|
||||
String type = call.arguments['type'];
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'hashComplete':
|
||||
String putID = data['putID'];
|
||||
String hash = data['hash'];
|
||||
int total = data['total'];
|
||||
_putFileListener?.hashComplete(putID, hash, total);
|
||||
break;
|
||||
case 'hashProgress':
|
||||
String putID = data['putID'];
|
||||
int current = data['current'];
|
||||
int total = data['total'];
|
||||
_putFileListener?.hashProgress(putID, current, total);
|
||||
break;
|
||||
case 'open':
|
||||
String putID = data['putID'];
|
||||
int size = data['size'];
|
||||
_putFileListener?.open(putID, size);
|
||||
break;
|
||||
case 'putComplete':
|
||||
String putID = data['putID'];
|
||||
int putType = data['putType'];
|
||||
int total = data['total'];
|
||||
_putFileListener?.putComplete(putID, putType, total);
|
||||
break;
|
||||
case 'putProgress':
|
||||
String putID = data['putID'];
|
||||
int save = data['save'];
|
||||
int current = data['current'];
|
||||
int total = data['total'];
|
||||
_putFileListener?.putProgress(putID, save, current, total);
|
||||
break;
|
||||
case 'putStart':
|
||||
String putID = data['putID'];
|
||||
int current = data['current'];
|
||||
int total = data['total'];
|
||||
_putFileListener?.putStart(putID, current, total);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (error, stackTrace) {
|
||||
Logger.print(
|
||||
@@ -404,7 +460,7 @@ class IMManager {
|
||||
/// [enabledEncryption] true:加密
|
||||
/// [enabledCompression] true:压缩
|
||||
Future<dynamic> initSDK({
|
||||
required int platform,
|
||||
required int platformID,
|
||||
required String apiAddr,
|
||||
required String wsAddr,
|
||||
required String dataDir,
|
||||
@@ -412,9 +468,11 @@ class IMManager {
|
||||
int logLevel = 6,
|
||||
String objectStorage = 'cos',
|
||||
String? encryptionKey,
|
||||
bool enabledEncryption = false,
|
||||
bool enabledCompression = false,
|
||||
bool isNeedEncryption = false,
|
||||
bool isCompression = false,
|
||||
bool isExternalExtensions = false,
|
||||
bool isLogStandardOutput = true,
|
||||
String? logFilePath,
|
||||
String? operationID,
|
||||
}) {
|
||||
this._connectListener = listener;
|
||||
@@ -423,32 +481,29 @@ class IMManager {
|
||||
'initSDK',
|
||||
_buildParam(
|
||||
{
|
||||
"platform": platform,
|
||||
"api_addr": apiAddr,
|
||||
"ws_addr": wsAddr,
|
||||
"data_dir": dataDir,
|
||||
"log_level": logLevel,
|
||||
"object_storage": objectStorage,
|
||||
"encryption_key": encryptionKey,
|
||||
"is_need_encryption": enabledEncryption,
|
||||
"is_compression": enabledCompression,
|
||||
"is_external_extensions": isExternalExtensions,
|
||||
"platformID": platformID,
|
||||
"apiAddr": apiAddr,
|
||||
"wsAddr": wsAddr,
|
||||
"dataDir": dataDir,
|
||||
"logLevel": logLevel,
|
||||
"objectStorage": objectStorage,
|
||||
"encryptionKey": encryptionKey,
|
||||
"isNeedEncryption": isNeedEncryption,
|
||||
"isCompression": isCompression,
|
||||
"isExternalExtensions": isExternalExtensions,
|
||||
"isLogStandardOutput": isLogStandardOutput,
|
||||
"logFilePath": logFilePath,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
/// 反初始化SDK
|
||||
Future<dynamic> unInitSDK() {
|
||||
return _channel.invokeMethod('unInitSDK', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 登录
|
||||
/// [uid] 用户id
|
||||
/// [token] 登录token,从业务服务器上获取
|
||||
/// [defaultValue] 获取失败后使用的默认值
|
||||
Future<UserInfo> login({
|
||||
required String uid,
|
||||
required String userID,
|
||||
required String token,
|
||||
String? operationID,
|
||||
Future<UserInfo> Function()? defaultValue,
|
||||
@@ -456,20 +511,20 @@ class IMManager {
|
||||
await _channel.invokeMethod(
|
||||
'login',
|
||||
_buildParam({
|
||||
'uid': uid,
|
||||
'userID': userID,
|
||||
'token': token,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
this.isLogined = true;
|
||||
this.uid = uid;
|
||||
this.userID = userID;
|
||||
this.token = token;
|
||||
try {
|
||||
return this.uInfo = await userManager.getSelfUserInfo();
|
||||
return this.userInfo = await userManager.getSelfUserInfo();
|
||||
} catch (error, stackTrace) {
|
||||
log('login e: $error s: $stackTrace');
|
||||
if (null != defaultValue) {
|
||||
return this.uInfo = await (defaultValue.call());
|
||||
return this.userInfo = await (defaultValue.call());
|
||||
}
|
||||
return Future.error(error, stackTrace);
|
||||
}
|
||||
@@ -493,34 +548,24 @@ class IMManager {
|
||||
_channel.invokeMethod<int>('getLoginStatus', _buildParam({}));
|
||||
|
||||
/// 获取当前登录用户id
|
||||
Future<String> getLoginUserID() async => uid;
|
||||
Future<String> getLoginUserID() async => userID;
|
||||
|
||||
/// 获取当前登录用户信息
|
||||
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
||||
Future<UserInfo> getLoginUserInfo() async => userInfo;
|
||||
|
||||
/// 从后台回到前台立刻唤醒
|
||||
Future wakeUp({String? operationID}) => _channel.invokeMethod(
|
||||
'wakeUp',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 上传图片到服务器
|
||||
/// [path] 图片路径
|
||||
/// [token] im token
|
||||
/// [objectStorage] 存储对象 cos/minio
|
||||
Future uploadImage({
|
||||
required String path,
|
||||
String? token,
|
||||
String? objectStorage,
|
||||
///
|
||||
Future putFile({
|
||||
required String putID,
|
||||
required String filePath,
|
||||
required String fileName,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'uploadImage',
|
||||
'putFile',
|
||||
_buildParam({
|
||||
'path': path,
|
||||
'token': token ?? this.token,
|
||||
'obj': objectStorage ?? this._objectStorage,
|
||||
'putID': putID,
|
||||
'filePath': filePath,
|
||||
'name': fileName,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -538,26 +583,30 @@ class IMManager {
|
||||
}));
|
||||
|
||||
/// 标记app处于后台
|
||||
Future setAppBackgroundStatus({
|
||||
required bool isBackground,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setAppBackgroundStatus',
|
||||
_buildParam({
|
||||
'isBackground': isBackground,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
// Future setAppBackgroundStatus({
|
||||
// required bool isBackground,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'setAppBackgroundStatus',
|
||||
// _buildParam({
|
||||
// 'isBackground': isBackground,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }));
|
||||
|
||||
/// 网络改变
|
||||
Future networkChanged({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'networkChanged',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
// Future networkStatusChanged({
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'networkStatusChanged',
|
||||
// _buildParam({
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }));
|
||||
|
||||
void setPutFileListener(OnPutFileListener listener) {
|
||||
_putFileListener = listener;
|
||||
}
|
||||
|
||||
///
|
||||
Future setListenerForService(OnListenerForService listener) {
|
||||
|
||||
@@ -52,59 +52,56 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||
/// [count] 一次拉取的总数
|
||||
Future<List<Message>> getHistoryMessageList({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getHistoryMessageList',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 10,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息[revokeMessageV2]
|
||||
/// [message] 被撤回的消息体
|
||||
@deprecated
|
||||
Future revokeMessage({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'revokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 删除本地消息
|
||||
/// [message] 被删除的消息体
|
||||
Future deleteMessageFromLocalStorage({
|
||||
required Message message,
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalStorage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"clientMsgID": clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// core-sdk: DeleteMessage
|
||||
/// 删除本地跟服务器的指定的消息
|
||||
/// [message] 被删除的消息
|
||||
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"clientMsgID": clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocal({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocal',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 插入单聊消息到本地
|
||||
/// [receiverID] 接收者id
|
||||
@@ -148,37 +145,6 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 标记c2c单条消息已读
|
||||
/// [userID] 消息来源的userID
|
||||
/// [messageIDList] 消息clientMsgID集合
|
||||
Future markC2CMessageAsRead({
|
||||
required String userID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markC2CMessageAsRead',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记群聊消息已读
|
||||
/// [groupID] 群id
|
||||
/// [messageIDList] 消息clientMsgID集合
|
||||
Future markGroupMessageAsRead({
|
||||
required String groupID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markGroupMessageAsRead',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"groupID": groupID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 正在输入提示
|
||||
/// [msgTip] 自定义内容
|
||||
@@ -489,14 +455,22 @@ class MessageManager {
|
||||
/// 创建卡片消息
|
||||
/// [data] 自定义数据
|
||||
Future<Message> createCardMessage({
|
||||
required Map<String, dynamic> data,
|
||||
required String userID,
|
||||
required String nickname,
|
||||
String? faceURL,
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'createCardMessage',
|
||||
_buildParam({
|
||||
'cardMessage': data,
|
||||
'cardMessage': {
|
||||
'userID': userID,
|
||||
'nickname': nickname,
|
||||
'faceURL': faceURL,
|
||||
'ex': ex,
|
||||
},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
@@ -519,32 +493,6 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 清空单聊消息记录
|
||||
/// [uid] 单聊对象id
|
||||
Future<dynamic> clearC2CHistoryMessage({
|
||||
required String uid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearC2CHistoryMessage',
|
||||
_buildParam({
|
||||
"userID": uid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 清空组消息记录
|
||||
/// [gid] 组id
|
||||
Future<dynamic> clearGroupHistoryMessage({
|
||||
required String gid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearGroupHistoryMessage',
|
||||
_buildParam({
|
||||
"groupID": gid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 搜索消息
|
||||
/// [conversationID] 根据会话查询,如果是全局搜索传null
|
||||
/// [keywordList] 搜索关键词列表,目前仅支持一个关键词搜索
|
||||
@@ -587,134 +535,46 @@ class MessageManager {
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
|
||||
/// 删除本地跟服务器的指定的消息
|
||||
/// [message] 被删除的消息
|
||||
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||
required Message message,
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessage({
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalAndSvr',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 删除本地所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocal({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocal',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocalAndSvr',
|
||||
'revokeMessage',
|
||||
_buildParam({
|
||||
'conversationID': conversationID,
|
||||
'clientMsgID': clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记消息已读
|
||||
/// [conversationID] 会话ID
|
||||
/// [messageIDList] 被标记的消息clientMsgID
|
||||
Future markMessageAsReadByConID({
|
||||
Future markMessagesAsReadByMsgID({
|
||||
required String conversationID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markMessageAsReadByConID',
|
||||
'markMessagesAsReadByMsgID',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"conversationID": conversationID,
|
||||
"messageIDList": messageIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器的单聊聊天记录
|
||||
/// [uid] 聊天对象的userID
|
||||
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
|
||||
required String uid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearC2CHistoryMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"userID": uid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器的群聊天记录
|
||||
/// [gid] 组id
|
||||
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
|
||||
required String gid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearGroupHistoryMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"groupID": gid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||
/// [count] 一次拉取的总数
|
||||
Future<List<Message>> getHistoryMessageListReverse({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getHistoryMessageListReverse',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 10,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessageV2({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'newRevokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||
/// [count] 一次拉取的总数
|
||||
/// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
|
||||
Future<AdvancedMessage> getAdvancedHistoryMessageList({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
int? lastMinSeq,
|
||||
Message? startMsg,
|
||||
int? lastMinSeq,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -722,8 +582,30 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'getAdvancedHistoryMessageList',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 40,
|
||||
'lastMinSeq': lastMinSeq ?? 0,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||
/// [count] 一次拉取的总数
|
||||
Future<AdvancedMessage> getAdvancedHistoryMessageListReverse({
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? lastMinSeq,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getAdvancedHistoryMessageListReverse',
|
||||
_buildParam({
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 40,
|
||||
@@ -876,7 +758,7 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 用户资料改变监听
|
||||
///
|
||||
Future setCustomBusinessListener(OnCustomBusinessListener listener) {
|
||||
this.customBusinessListener = listener;
|
||||
return _channel.invokeMethod('setCustomBusinessListener', _buildParam({}));
|
||||
|
||||
@@ -1,162 +1,162 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OrganizationManager {
|
||||
MethodChannel _channel;
|
||||
late OnOrganizationListener listener;
|
||||
|
||||
OrganizationManager(this._channel);
|
||||
|
||||
/// 组织架构发生变化回调
|
||||
Future setOrganizationListener(OnOrganizationListener listener) {
|
||||
this.listener = listener;
|
||||
return _channel.invokeMethod('setOrganizationListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 获取子部门列表,返回当前部门下的一级子部门
|
||||
/// [departmentID] 当前部门id
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<DeptInfo>> getSubDept({
|
||||
required String departmentID,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSubDepartment',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => DeptInfo.fromJson(v)));
|
||||
|
||||
/// 获取部门下的成员列表,返回当前部门下的一级成员
|
||||
/// [departmentID] 当前部门id
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<DeptMemberInfo>> getDeptMember({
|
||||
required String departmentID,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentMember',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (v) => DeptMemberInfo.fromJson(v)));
|
||||
|
||||
/// 获取成员所在的部门
|
||||
/// [userID] 成员ID
|
||||
Future<List<UserInDept>> getUserInDept({
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getUserInDepartment',
|
||||
_buildParam({
|
||||
'userID': userID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInDept.fromJson(v)));
|
||||
|
||||
/// 获取部门下的子部门跟员工
|
||||
/// [departmentID] 当前部门id
|
||||
Future<DeptMemberAndSubDept> getDeptMemberAndSubDept({
|
||||
required String departmentID,
|
||||
// int departmentOffset = 0,
|
||||
// int departmentCount = 40,
|
||||
// int memberOffset = 0,
|
||||
// int memberCount = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentMemberAndSubDepartment',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
// 'departmentOffset': departmentOffset,
|
||||
// 'departmentCount': departmentCount,
|
||||
// 'memberOffset': memberOffset,
|
||||
// 'memberCount': memberCount,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v)));
|
||||
|
||||
/// 查询部门信息
|
||||
/// [departmentID] 部门ID
|
||||
Future<DeptInfo> getDeptInfo({
|
||||
required String departmentID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentInfo',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (v) => DeptInfo.fromJson(v)));
|
||||
|
||||
/// 搜索组织人员
|
||||
/// [keyWord] 关键字
|
||||
/// [isSearchUserName] 是否匹配用户名
|
||||
/// [isSearchEnglishName] 是否匹配英文名
|
||||
/// [isSearchPosition] 是否匹配职位
|
||||
/// [isSearchUserID] 是否匹配用户ID
|
||||
/// [isSearchMobile] 是否匹配手机号
|
||||
/// [isSearchEmail] 是否匹配邮箱号
|
||||
/// [isSearchTelephone] 是否匹配电话号码
|
||||
/// [offset] 开始下标
|
||||
/// [count] 分页大小
|
||||
Future<OrganizationSearchResult> searchOrganization({
|
||||
required String keyWord,
|
||||
bool isSearchUserName = false,
|
||||
bool isSearchEnglishName = false,
|
||||
bool isSearchPosition = false,
|
||||
bool isSearchUserID = false,
|
||||
bool isSearchMobile = false,
|
||||
bool isSearchEmail = false,
|
||||
bool isSearchTelephone = false,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'searchOrganization',
|
||||
_buildParam({
|
||||
'searchParam': {
|
||||
'keyWord': keyWord,
|
||||
'isSearchUserName': isSearchUserName,
|
||||
'isSearchEnglishName': isSearchEnglishName,
|
||||
'isSearchPosition': isSearchPosition,
|
||||
'isSearchUserID': isSearchUserID,
|
||||
'isSearchMobile': isSearchMobile,
|
||||
'isSearchEmail': isSearchEmail,
|
||||
'isSearchTelephone': isSearchTelephone,
|
||||
},
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (v) => OrganizationSearchResult.fromJson(v)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "organizationManager";
|
||||
return param;
|
||||
}
|
||||
}
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
//
|
||||
// class OrganizationManager {
|
||||
// MethodChannel _channel;
|
||||
// late OnOrganizationListener listener;
|
||||
//
|
||||
// OrganizationManager(this._channel);
|
||||
//
|
||||
// /// 组织架构发生变化回调
|
||||
// Future setOrganizationListener(OnOrganizationListener listener) {
|
||||
// this.listener = listener;
|
||||
// return _channel.invokeMethod('setOrganizationListener', _buildParam({}));
|
||||
// }
|
||||
//
|
||||
// /// 获取子部门列表,返回当前部门下的一级子部门
|
||||
// /// [departmentID] 当前部门id
|
||||
// /// [offset] 开始下标
|
||||
// /// [count] 每页大小
|
||||
// Future<List<DeptInfo>> getSubDept({
|
||||
// required String departmentID,
|
||||
// int offset = 0,
|
||||
// int count = 40,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getSubDepartment',
|
||||
// _buildParam({
|
||||
// 'departmentID': departmentID,
|
||||
// 'offset': offset,
|
||||
// 'count': count,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) => Utils.toList(value, (v) => DeptInfo.fromJson(v)));
|
||||
//
|
||||
// /// 获取部门下的成员列表,返回当前部门下的一级成员
|
||||
// /// [departmentID] 当前部门id
|
||||
// /// [offset] 开始下标
|
||||
// /// [count] 每页大小
|
||||
// Future<List<DeptMemberInfo>> getDeptMember({
|
||||
// required String departmentID,
|
||||
// int offset = 0,
|
||||
// int count = 40,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getDepartmentMember',
|
||||
// _buildParam({
|
||||
// 'departmentID': departmentID,
|
||||
// 'offset': offset,
|
||||
// 'count': count,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) =>
|
||||
// Utils.toList(value, (v) => DeptMemberInfo.fromJson(v)));
|
||||
//
|
||||
// /// 获取成员所在的部门
|
||||
// /// [userID] 成员ID
|
||||
// Future<List<UserInDept>> getUserInDept({
|
||||
// required String userID,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getUserInDepartment',
|
||||
// _buildParam({
|
||||
// 'userID': userID,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) => Utils.toList(value, (v) => UserInDept.fromJson(v)));
|
||||
//
|
||||
// /// 获取部门下的子部门跟员工
|
||||
// /// [departmentID] 当前部门id
|
||||
// Future<DeptMemberAndSubDept> getDeptMemberAndSubDept({
|
||||
// required String departmentID,
|
||||
// // int departmentOffset = 0,
|
||||
// // int departmentCount = 40,
|
||||
// // int memberOffset = 0,
|
||||
// // int memberCount = 40,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getDepartmentMemberAndSubDepartment',
|
||||
// _buildParam({
|
||||
// 'departmentID': departmentID,
|
||||
// // 'departmentOffset': departmentOffset,
|
||||
// // 'departmentCount': departmentCount,
|
||||
// // 'memberOffset': memberOffset,
|
||||
// // 'memberCount': memberCount,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) =>
|
||||
// Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v)));
|
||||
//
|
||||
// /// 查询部门信息
|
||||
// /// [departmentID] 部门ID
|
||||
// Future<DeptInfo> getDeptInfo({
|
||||
// required String departmentID,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getDepartmentInfo',
|
||||
// _buildParam({
|
||||
// 'departmentID': departmentID,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) => Utils.toObj(value, (v) => DeptInfo.fromJson(v)));
|
||||
//
|
||||
// /// 搜索组织人员
|
||||
// /// [keyWord] 关键字
|
||||
// /// [isSearchUserName] 是否匹配用户名
|
||||
// /// [isSearchEnglishName] 是否匹配英文名
|
||||
// /// [isSearchPosition] 是否匹配职位
|
||||
// /// [isSearchUserID] 是否匹配用户ID
|
||||
// /// [isSearchMobile] 是否匹配手机号
|
||||
// /// [isSearchEmail] 是否匹配邮箱号
|
||||
// /// [isSearchTelephone] 是否匹配电话号码
|
||||
// /// [offset] 开始下标
|
||||
// /// [count] 分页大小
|
||||
// Future<OrganizationSearchResult> searchOrganization({
|
||||
// required String keyWord,
|
||||
// bool isSearchUserName = false,
|
||||
// bool isSearchEnglishName = false,
|
||||
// bool isSearchPosition = false,
|
||||
// bool isSearchUserID = false,
|
||||
// bool isSearchMobile = false,
|
||||
// bool isSearchEmail = false,
|
||||
// bool isSearchTelephone = false,
|
||||
// int offset = 0,
|
||||
// int count = 40,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'searchOrganization',
|
||||
// _buildParam({
|
||||
// 'searchParam': {
|
||||
// 'keyWord': keyWord,
|
||||
// 'isSearchUserName': isSearchUserName,
|
||||
// 'isSearchEnglishName': isSearchEnglishName,
|
||||
// 'isSearchPosition': isSearchPosition,
|
||||
// 'isSearchUserID': isSearchUserID,
|
||||
// 'isSearchMobile': isSearchMobile,
|
||||
// 'isSearchEmail': isSearchEmail,
|
||||
// 'isSearchTelephone': isSearchTelephone,
|
||||
// },
|
||||
// 'offset': offset,
|
||||
// 'count': count,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) =>
|
||||
// Utils.toObj(value, (v) => OrganizationSearchResult.fromJson(v)));
|
||||
//
|
||||
// static Map _buildParam(Map param) {
|
||||
// param["ManagerName"] = "organizationManager";
|
||||
// return param;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -14,16 +14,16 @@ class UserManager {
|
||||
}
|
||||
|
||||
/// 获取用户资料
|
||||
/// [uidList] 用户ID列表
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<UserInfo>> getUsersInfo({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getUsersInfo',
|
||||
_buildParam({
|
||||
'uidList': uidList,
|
||||
'userIDList': userIDList,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class WorkMomentsManager {
|
||||
MethodChannel _channel;
|
||||
late OnWorkMomentsListener listener;
|
||||
|
||||
WorkMomentsManager(this._channel);
|
||||
|
||||
/// 朋友圈信息发送变化通知
|
||||
Future setWorkMomentsListener(OnWorkMomentsListener listener) {
|
||||
this.listener = listener;
|
||||
return _channel.invokeMethod('setWorkMomentsListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 获取朋友圈未读消息总数
|
||||
Future<int> getWorkMomentsUnReadCount({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getWorkMomentsUnReadCount',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => map['unreadCount']));
|
||||
|
||||
/// 获取通知列表
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<WorkMomentsInfo>> getWorkMomentsNotification({
|
||||
required int offset,
|
||||
required int count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getWorkMomentsNotification',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => WorkMomentsInfo.fromJson(map)));
|
||||
|
||||
/// 清除通知列表
|
||||
Future clearWorkMomentsNotification({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearWorkMomentsNotification',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "workMomentsManager";
|
||||
return param;
|
||||
}
|
||||
}
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
//
|
||||
// class WorkMomentsManager {
|
||||
// MethodChannel _channel;
|
||||
// late OnWorkMomentsListener listener;
|
||||
//
|
||||
// WorkMomentsManager(this._channel);
|
||||
//
|
||||
// /// 朋友圈信息发送变化通知
|
||||
// Future setWorkMomentsListener(OnWorkMomentsListener listener) {
|
||||
// this.listener = listener;
|
||||
// return _channel.invokeMethod('setWorkMomentsListener', _buildParam({}));
|
||||
// }
|
||||
//
|
||||
// /// 获取朋友圈未读消息总数
|
||||
// Future<int> getWorkMomentsUnReadCount({
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getWorkMomentsUnReadCount',
|
||||
// _buildParam({
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) => Utils.toObj(value, (map) => map['unreadCount']));
|
||||
//
|
||||
// /// 获取通知列表
|
||||
// /// [offset] 开始下标
|
||||
// /// [count] 每页大小
|
||||
// Future<List<WorkMomentsInfo>> getWorkMomentsNotification({
|
||||
// required int offset,
|
||||
// required int count,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel
|
||||
// .invokeMethod(
|
||||
// 'getWorkMomentsNotification',
|
||||
// _buildParam({
|
||||
// 'offset': offset,
|
||||
// 'count': count,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }))
|
||||
// .then((value) =>
|
||||
// Utils.toList(value, (map) => WorkMomentsInfo.fromJson(map)));
|
||||
//
|
||||
// /// 清除通知列表
|
||||
// Future clearWorkMomentsNotification({
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'clearWorkMomentsNotification',
|
||||
// _buildParam({
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }));
|
||||
//
|
||||
// static Map _buildParam(Map param) {
|
||||
// param["ManagerName"] = "workMomentsManager";
|
||||
// return param;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -43,7 +43,7 @@ class Message {
|
||||
String? groupID;
|
||||
|
||||
/// 消息内容
|
||||
String? content;
|
||||
// String? content;
|
||||
|
||||
/// 消息的seq
|
||||
int? seq;
|
||||
@@ -57,6 +57,10 @@ class Message {
|
||||
/// 消息发送状态[MessageStatus]
|
||||
int? status;
|
||||
|
||||
bool? isReact;
|
||||
|
||||
bool? isExternalExtensions;
|
||||
|
||||
/// 离线显示内容
|
||||
OfflinePushInfo? offlinePush;
|
||||
|
||||
@@ -67,7 +71,7 @@ class Message {
|
||||
String? ex;
|
||||
|
||||
/// 自定义扩展信息,目前用于客服端处理消息时间分段
|
||||
dynamic ext;
|
||||
Map<String, dynamic> exMap = {};
|
||||
|
||||
/// 图片
|
||||
PictureElem? pictureElem;
|
||||
@@ -82,7 +86,7 @@ class Message {
|
||||
FileElem? fileElem;
|
||||
|
||||
/// @信息
|
||||
AtElem? atElem;
|
||||
AtTextElem? atTextElem;
|
||||
|
||||
/// 位置
|
||||
LocationElem? locationElem;
|
||||
@@ -105,9 +109,17 @@ class Message {
|
||||
/// 附加信息
|
||||
AttachedInfoElem? attachedInfoElem;
|
||||
|
||||
bool? isReact;
|
||||
/// 文本内容
|
||||
TextElem? textElem;
|
||||
|
||||
bool? isExternal;
|
||||
/// 个人名片
|
||||
CardElem? cardElem;
|
||||
|
||||
///
|
||||
AdvancedTextElem? advancedTextElem;
|
||||
|
||||
///
|
||||
TypingElem? typingElem;
|
||||
|
||||
Message({
|
||||
this.clientMsgID,
|
||||
@@ -123,7 +135,7 @@ class Message {
|
||||
this.senderNickname,
|
||||
this.senderFaceUrl,
|
||||
this.groupID,
|
||||
this.content,
|
||||
// this.content,
|
||||
this.seq,
|
||||
this.isRead,
|
||||
this.hasReadTime,
|
||||
@@ -131,12 +143,12 @@ class Message {
|
||||
this.offlinePush,
|
||||
this.attachedInfo,
|
||||
this.ex,
|
||||
this.ext,
|
||||
this.exMap = const <String, dynamic>{},
|
||||
this.pictureElem,
|
||||
this.soundElem,
|
||||
this.videoElem,
|
||||
this.fileElem,
|
||||
this.atElem,
|
||||
this.atTextElem,
|
||||
this.locationElem,
|
||||
this.customElem,
|
||||
this.quoteElem,
|
||||
@@ -144,8 +156,12 @@ class Message {
|
||||
this.notificationElem,
|
||||
this.faceElem,
|
||||
this.attachedInfoElem,
|
||||
this.isExternal,
|
||||
this.isExternalExtensions,
|
||||
this.isReact,
|
||||
this.textElem,
|
||||
this.cardElem,
|
||||
this.advancedTextElem,
|
||||
this.typingElem,
|
||||
});
|
||||
|
||||
Message.fromJson(Map<String, dynamic> json) {
|
||||
@@ -161,7 +177,7 @@ class Message {
|
||||
senderNickname = json['senderNickname'];
|
||||
senderFaceUrl = json['senderFaceUrl'];
|
||||
groupID = json['groupID'];
|
||||
content = json['content'];
|
||||
// content = json['content'];
|
||||
seq = json['seq'];
|
||||
isRead = json['isRead'];
|
||||
status = json['status'];
|
||||
@@ -170,7 +186,7 @@ class Message {
|
||||
: null;
|
||||
attachedInfo = json['attachedInfo'];
|
||||
ex = json['ex'];
|
||||
ext = json['ext'];
|
||||
exMap = json['exMap'] ?? {};
|
||||
sessionType = json['sessionType'];
|
||||
pictureElem = json['pictureElem'] != null
|
||||
? PictureElem.fromJson(json['pictureElem'])
|
||||
@@ -183,7 +199,9 @@ class Message {
|
||||
: null;
|
||||
fileElem =
|
||||
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||
atElem = json['atElem'] != null ? AtElem.fromJson(json['atElem']) : null;
|
||||
atTextElem = json['atTextElem'] != null
|
||||
? AtTextElem.fromJson(json['atTextElem'])
|
||||
: null;
|
||||
locationElem = json['locationElem'] != null
|
||||
? LocationElem.fromJson(json['locationElem'])
|
||||
: null;
|
||||
@@ -206,8 +224,18 @@ class Message {
|
||||
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
|
||||
: null;
|
||||
hasReadTime = json['hasReadTime'] ?? attachedInfoElem?.hasReadTime;
|
||||
isExternal = json['isExternal'];
|
||||
isExternalExtensions = json['isExternalExtensions'];
|
||||
isReact = json['isReact'];
|
||||
textElem =
|
||||
json['textElem'] != null ? TextElem.fromJson(json['textElem']) : null;
|
||||
cardElem =
|
||||
json['cardElem'] != null ? CardElem.fromJson(json['cardElem']) : null;
|
||||
advancedTextElem = json['advancedTextElem'] != null
|
||||
? AdvancedTextElem.fromJson(json['advancedTextElem'])
|
||||
: null;
|
||||
typingElem = json['typingElem'] != null
|
||||
? TypingElem.fromJson(json['typingElem'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -224,7 +252,7 @@ class Message {
|
||||
data['senderNickname'] = this.senderNickname;
|
||||
data['senderFaceUrl'] = this.senderFaceUrl;
|
||||
data['groupID'] = this.groupID;
|
||||
data['content'] = this.content;
|
||||
// data['content'] = this.content;
|
||||
data['seq'] = this.seq;
|
||||
data['isRead'] = this.isRead;
|
||||
data['hasReadTime'] = this.hasReadTime;
|
||||
@@ -232,13 +260,13 @@ class Message {
|
||||
data['offlinePush'] = this.offlinePush?.toJson();
|
||||
data['attachedInfo'] = this.attachedInfo;
|
||||
data['ex'] = this.ex;
|
||||
data['ext'] = this.ext;
|
||||
data['exMap'] = this.exMap;
|
||||
data['sessionType'] = this.sessionType;
|
||||
data['pictureElem'] = this.pictureElem?.toJson();
|
||||
data['soundElem'] = this.soundElem?.toJson();
|
||||
data['videoElem'] = this.videoElem?.toJson();
|
||||
data['fileElem'] = this.fileElem?.toJson();
|
||||
data['atElem'] = this.atElem?.toJson();
|
||||
data['atTextElem'] = this.atTextElem?.toJson();
|
||||
data['locationElem'] = this.locationElem?.toJson();
|
||||
data['customElem'] = this.customElem?.toJson();
|
||||
data['quoteElem'] = this.quoteElem?.toJson();
|
||||
@@ -246,8 +274,12 @@ class Message {
|
||||
data['notificationElem'] = this.notificationElem?.toJson();
|
||||
data['faceElem'] = this.faceElem?.toJson();
|
||||
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
|
||||
data['isExternal'] = this.isExternal;
|
||||
data['isExternalExtensions'] = this.isExternalExtensions;
|
||||
data['isReact'] = this.isReact;
|
||||
data['textElem'] = this.textElem?.toJson();
|
||||
data['cardElem'] = this.cardElem?.toJson();
|
||||
data['advancedTextElem'] = this.advancedTextElem?.toJson();
|
||||
data['typingElem'] = this.typingElem?.toJson();
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -274,7 +306,7 @@ class Message {
|
||||
senderNickname = message.senderNickname;
|
||||
senderFaceUrl = message.senderFaceUrl;
|
||||
groupID = message.groupID;
|
||||
content = message.content;
|
||||
// content = message.content;
|
||||
seq = message.seq;
|
||||
isRead = message.isRead;
|
||||
hasReadTime = message.hasReadTime;
|
||||
@@ -282,13 +314,13 @@ class Message {
|
||||
offlinePush = message.offlinePush;
|
||||
attachedInfo = message.attachedInfo;
|
||||
ex = message.ex;
|
||||
ext = message.ext;
|
||||
exMap = message.exMap;
|
||||
sessionType = message.sessionType;
|
||||
pictureElem = message.pictureElem;
|
||||
soundElem = message.soundElem;
|
||||
videoElem = message.videoElem;
|
||||
fileElem = message.fileElem;
|
||||
atElem = message.atElem;
|
||||
atTextElem = message.atTextElem;
|
||||
locationElem = message.locationElem;
|
||||
customElem = message.customElem;
|
||||
quoteElem = message.quoteElem;
|
||||
@@ -296,6 +328,10 @@ class Message {
|
||||
notificationElem = message.notificationElem;
|
||||
faceElem = message.faceElem;
|
||||
attachedInfoElem = message.attachedInfoElem;
|
||||
textElem = message.textElem;
|
||||
cardElem = message.cardElem;
|
||||
advancedTextElem = message.advancedTextElem;
|
||||
typingElem = message.typingElem;
|
||||
}
|
||||
|
||||
/// 单聊消息
|
||||
@@ -568,7 +604,7 @@ class FileElem {
|
||||
}
|
||||
|
||||
/// @消息内容
|
||||
class AtElem {
|
||||
class AtTextElem {
|
||||
/// 消息内容
|
||||
String? text;
|
||||
|
||||
@@ -584,7 +620,7 @@ class AtElem {
|
||||
/// 被回复的消息体,回复别人并@了人
|
||||
Message? quoteMessage;
|
||||
|
||||
AtElem({
|
||||
AtTextElem({
|
||||
this.text,
|
||||
this.atUserList,
|
||||
this.isAtSelf,
|
||||
@@ -592,7 +628,7 @@ class AtElem {
|
||||
this.quoteMessage,
|
||||
});
|
||||
|
||||
AtElem.fromJson(Map<String, dynamic> json) {
|
||||
AtTextElem.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'];
|
||||
if (json['atUserList'] is List) {
|
||||
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
|
||||
@@ -836,6 +872,115 @@ class AttachedInfoElem {
|
||||
}
|
||||
}
|
||||
|
||||
class TextElem {
|
||||
String? content;
|
||||
|
||||
TextElem({this.content});
|
||||
|
||||
TextElem.fromJson(Map<String, dynamic> json) {
|
||||
content = json['content'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['content'] = content;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CardElem {
|
||||
String? userID;
|
||||
String? nickname;
|
||||
String? faceURL;
|
||||
String? ex;
|
||||
|
||||
CardElem({this.userID, this.nickname, this.faceURL, this.ex});
|
||||
|
||||
CardElem.fromJson(Map<String, dynamic> json) {
|
||||
userID = json['userID'];
|
||||
nickname = json['nickname'];
|
||||
faceURL = json['faceURL'];
|
||||
ex = json['ex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['userID'] = userID;
|
||||
data['nickname'] = nickname;
|
||||
data['faceURL'] = faceURL;
|
||||
data['ex'] = ex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TypingElem {
|
||||
String? msgTips;
|
||||
|
||||
TypingElem({this.msgTips});
|
||||
|
||||
TypingElem.fromJson(Map<String, dynamic> json) {
|
||||
msgTips = json['msgTips'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['msgTips'] = msgTips;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class AdvancedTextElem {
|
||||
String? text;
|
||||
List<MessageEntity>? messageEntityList;
|
||||
|
||||
AdvancedTextElem({this.text, this.messageEntityList});
|
||||
|
||||
AdvancedTextElem.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'];
|
||||
messageEntityList = json['messageEntityList'] == null
|
||||
? null
|
||||
: (json['messageEntityList'] as List)
|
||||
.map((e) => MessageEntity.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['text'] = text;
|
||||
data['messageEntityList'] =
|
||||
messageEntityList?.map((e) => e.toJson()).toList();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MessageEntity {
|
||||
String? type;
|
||||
int? offset;
|
||||
int? length;
|
||||
String? url;
|
||||
String? ex;
|
||||
|
||||
MessageEntity({this.type, this.offset, this.length, this.url, this.ex});
|
||||
|
||||
MessageEntity.fromJson(Map<String, dynamic> json) {
|
||||
type = json['type'];
|
||||
offset = json['offset'];
|
||||
length = json['length'];
|
||||
url = json['url'];
|
||||
ex = json['ex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['type'] = type;
|
||||
data['offset'] = offset;
|
||||
data['length'] = length;
|
||||
data['url'] = url;
|
||||
data['ex'] = ex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 群消息已读信息
|
||||
class GroupHasReadInfo {
|
||||
/// 已读的用户id列表
|
||||
|
||||
@@ -20,11 +20,8 @@ class UserInfo {
|
||||
/// 手机号
|
||||
String? phoneNumber;
|
||||
|
||||
/// 使用[birthTime]
|
||||
int? birth;
|
||||
|
||||
/// 出生时间
|
||||
String? birthTime;
|
||||
int? birth;
|
||||
|
||||
/// 邮箱
|
||||
String? email;
|
||||
@@ -38,21 +35,6 @@ class UserInfo {
|
||||
/// 备注
|
||||
String? remark;
|
||||
|
||||
/// 用户公开的资料
|
||||
PublicUserInfo? publicInfo;
|
||||
|
||||
/// 好友才能查看的资料
|
||||
FriendInfo? friendInfo;
|
||||
|
||||
/// 黑名单资料
|
||||
BlacklistInfo? blackInfo;
|
||||
|
||||
/// 是否好友关系
|
||||
bool? isFriendship;
|
||||
|
||||
/// 是否黑名单
|
||||
bool? isBlacklist;
|
||||
|
||||
/// 全局免打扰 0:正常;1:不接受消息;2:接受在线消息不接受离线消息;
|
||||
int? globalRecvMsgOpt;
|
||||
|
||||
@@ -68,6 +50,21 @@ class UserInfo {
|
||||
/// 禁止登录
|
||||
int? forbidden;
|
||||
|
||||
/// 用户公开的资料
|
||||
PublicUserInfo? publicInfo;
|
||||
|
||||
/// 好友才能查看的资料
|
||||
FriendInfo? friendInfo;
|
||||
|
||||
/// 黑名单资料
|
||||
BlacklistInfo? blackInfo;
|
||||
|
||||
/// 是否好友关系
|
||||
bool? isFriendship;
|
||||
|
||||
/// 是否黑名单
|
||||
bool? isBlacklist;
|
||||
|
||||
UserInfo({
|
||||
this.publicInfo,
|
||||
this.friendInfo,
|
||||
@@ -80,7 +77,6 @@ class UserInfo {
|
||||
this.faceURL,
|
||||
this.phoneNumber,
|
||||
this.birth,
|
||||
this.birthTime,
|
||||
this.gender,
|
||||
this.email,
|
||||
this.ex,
|
||||
@@ -125,7 +121,6 @@ class UserInfo {
|
||||
gender = json['gender'] ?? _gender;
|
||||
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
|
||||
birth = json['birth'] ?? _birth;
|
||||
birthTime = json['birthTime'] ?? _birthTime;
|
||||
email = json['email'] ?? _email;
|
||||
remark = json['remark'] ?? _remark;
|
||||
ex = json['ex'] ?? _ex;
|
||||
@@ -151,7 +146,6 @@ class UserInfo {
|
||||
data['gender'] = this.gender;
|
||||
data['phoneNumber'] = this.phoneNumber;
|
||||
data['birth'] = this.birth;
|
||||
data['birthTime'] = this.birthTime;
|
||||
data['email'] = this.email;
|
||||
data['ex'] = this.ex;
|
||||
data['createTime'] = this.createTime;
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
class WorkMomentsInfo {
|
||||
int? notificationMsgType;
|
||||
String? replyUserName;
|
||||
String? replyUserID;
|
||||
String? content;
|
||||
String? contentID;
|
||||
String? workMomentID;
|
||||
String? userID;
|
||||
String? userName;
|
||||
String? faceURL;
|
||||
String? workMomentContent;
|
||||
int? createTime;
|
||||
|
||||
WorkMomentsInfo(
|
||||
{this.notificationMsgType,
|
||||
this.replyUserName,
|
||||
this.replyUserID,
|
||||
this.content,
|
||||
this.contentID,
|
||||
this.workMomentID,
|
||||
this.userID,
|
||||
this.userName,
|
||||
this.faceURL,
|
||||
this.workMomentContent,
|
||||
this.createTime});
|
||||
|
||||
WorkMomentsInfo.fromJson(Map<String, dynamic> json) {
|
||||
notificationMsgType = json['notificationMsgType'];
|
||||
replyUserName = json['replyUserName'];
|
||||
replyUserID = json['replyUserID'];
|
||||
content = json['content'];
|
||||
contentID = json['contentID'];
|
||||
workMomentID = json['workMomentID'];
|
||||
userID = json['userID'];
|
||||
userName = json['userName'];
|
||||
faceURL = json['faceURL'];
|
||||
workMomentContent = json['workMomentContent'];
|
||||
createTime = json['createTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['notificationMsgType'] = this.notificationMsgType;
|
||||
data['replyUserName'] = this.replyUserName;
|
||||
data['replyUserID'] = this.replyUserID;
|
||||
data['content'] = this.content;
|
||||
data['contentID'] = this.contentID;
|
||||
data['workMomentID'] = this.workMomentID;
|
||||
data['userID'] = this.userID;
|
||||
data['userName'] = this.userName;
|
||||
data['faceURL'] = this.faceURL;
|
||||
data['workMomentContent'] = this.workMomentContent;
|
||||
data['createTime'] = this.createTime;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
// class WorkMomentsInfo {
|
||||
// int? notificationMsgType;
|
||||
// String? replyUserName;
|
||||
// String? replyUserID;
|
||||
// String? content;
|
||||
// String? contentID;
|
||||
// String? workMomentID;
|
||||
// String? userID;
|
||||
// String? userName;
|
||||
// String? faceURL;
|
||||
// String? workMomentContent;
|
||||
// int? createTime;
|
||||
//
|
||||
// WorkMomentsInfo(
|
||||
// {this.notificationMsgType,
|
||||
// this.replyUserName,
|
||||
// this.replyUserID,
|
||||
// this.content,
|
||||
// this.contentID,
|
||||
// this.workMomentID,
|
||||
// this.userID,
|
||||
// this.userName,
|
||||
// this.faceURL,
|
||||
// this.workMomentContent,
|
||||
// this.createTime});
|
||||
//
|
||||
// WorkMomentsInfo.fromJson(Map<String, dynamic> json) {
|
||||
// notificationMsgType = json['notificationMsgType'];
|
||||
// replyUserName = json['replyUserName'];
|
||||
// replyUserID = json['replyUserID'];
|
||||
// content = json['content'];
|
||||
// contentID = json['contentID'];
|
||||
// workMomentID = json['workMomentID'];
|
||||
// userID = json['userID'];
|
||||
// userName = json['userName'];
|
||||
// faceURL = json['faceURL'];
|
||||
// workMomentContent = json['workMomentContent'];
|
||||
// createTime = json['createTime'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['notificationMsgType'] = this.notificationMsgType;
|
||||
// data['replyUserName'] = this.replyUserName;
|
||||
// data['replyUserID'] = this.replyUserID;
|
||||
// data['content'] = this.content;
|
||||
// data['contentID'] = this.contentID;
|
||||
// data['workMomentID'] = this.workMomentID;
|
||||
// data['userID'] = this.userID;
|
||||
// data['userName'] = this.userName;
|
||||
// data['faceURL'] = this.faceURL;
|
||||
// data['workMomentContent'] = this.workMomentContent;
|
||||
// data['createTime'] = this.createTime;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user