Update error code

main
hrxiang 2 years ago
parent 169da36d0b
commit 27eb0f78d2
  1. 18
      android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java
  2. 177
      lib/src/enum/sdk_error_code.dart
  3. 30
      lib/src/manager/im_conversation_manager.dart
  4. 17
      lib/src/models/conversation_info.dart
  5. 16
      lib/src/models/meeting_info.dart
  6. 10
      lib/src/models/signaling_info.dart

@ -175,4 +175,22 @@ public class ConversationManager extends BaseManager {
value(methodCall, "burnDuration")
);
}
public void setConversationIsMsgDestruct(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationIsMsgDestruct(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "isMsgDestruct")
);
}
public void setConversationMsgDestructTime(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationMsgDestructTime(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
int2long(methodCall, "duration")
);
}
}

@ -1,17 +1,172 @@
///
class MessageFailedCode {
///
static const int blockedByFriend = 1302;
// ///
// class MessageFailedCode {
// ///
// static const int blockedByFriend = 1302;
//
// ///
// static const int deletedByFriend = 1303;
//
// /// /
// static const int notInGroup = 1204;
// }
//
// ///
// class AddFriendFailedCode {
// ///
// static const int refuseToAddFriends = 10013;
// }
///
static const int deletedByFriend = 601;
class SDKErrorCode {
///
static const int networkRequestError = 10000;
/// /
static const int notInGroup = 1205;
}
///
static const int networkWaitTimeoutError = 10001;
///
static const int parameterError = 10002;
/// 退
static const int contextTimeoutError = 10003;
///
static const int resourceNotLoaded = 10004;
/// errmsg
static const int unknownError = 10005;
/// sdk errmsg
static const int sdkInternalError = 10006;
///
class AddFriendFailedCode {
///
static const int refuseToAddFriends = 10013;
///
static const int userNotExistOrNotRegistered = 10100;
/// 退
static const int userHasLoggedOut = 10101;
/// getloginstatus
static const int repeatLogin = 10102;
///
static const int uploadFileNotExist = 10200;
///
static const int messageDecompressionFailed = 10201;
///
static const int messageDecodingFailed = 10202;
///
static const int unsupportedLongConnection = 10203;
///
static const int messageRepeated = 10204;
///
static const int messageContentTypeNotSupported = 10205;
///
static const int unsupportedSessionOperation = 10301;
/// ID
static const int groupIDNotExist = 10400;
///
static const int wrongGroupType = 10401;
///
static const int serverInternalError = 500;
/// body header
static const int serverParameterError = 1001;
/// header token
static const int insufficientPermissions = 1002;
///
static const int duplicateDatabasePrimaryKey = 1003;
///
static const int databaseRecordNotFound = 1004;
/// ID
static const int userIDNotExist = 1101;
///
static const int userAlreadyRegistered = 1102;
///
static const int groupNotExis = 1201;
///
static const int groupAlreadyExists = 1202;
///
static const int userIsNotInGroup = 1203;
///
static const int groupDisbanded = 1204;
///
static const int groupApplicationHasBeenProcessed = 1206;
///
static const int notAddMyselfAsAFriend = 1301;
///
static const int hasBeenBlocked = 1302;
///
static const int notFriend = 1303;
///
static const int alreadyAFriendRelationship = 1304;
///
static const int messageReadFunctionIsTurnedOff = 1401;
///
static const int youHaveBeenBanned = 1402;
///
static const int groupHasBeenBanned = 1403;
///
static const int messageHasBeenRetracted = 1404;
///
static const int licenseExpired = 1405;
/// token
static const int tokenHasExpired = 1501;
/// token
static const int tokenInvalid = 1502;
/// token
static const int tokenFormatError = 1503;
/// token
static const int tokenHasNotYetTakenEffect = 1504;
/// token
static const int unknownTokenError = 1505;
/// token
static const int thekickedOutTokenIsInvalid = 1506;
/// token
static const int tokenNotExist = 1507;
///
static const int connectionsExceedsMaximumLimit = 1601;
///
static const int handshakeParameterError = 1602;
///
static const int fileUploadExpired = 1701;
}

@ -304,6 +304,36 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [isMsgDestruct] true
Future<dynamic> setConversationIsMsgDestruct({
required String conversationID,
bool isMsgDestruct = true,
String? operationID,
}) =>
_channel.invokeMethod(
'setConversationIsMsgDestruct',
_buildParam({
"conversationID": conversationID,
"isMsgDestruct": isMsgDestruct,
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [duration]
Future<dynamic> setConversationMsgDestructTime({
required String conversationID,
int duration = 1 * 24 * 60 * 60,
String? operationID,
}) =>
_channel.invokeMethod(
'setConversationMsgDestructTime',
_buildParam({
"conversationID": conversationID,
"duration": duration,
"operationID": Utils.checkOperationID(operationID),
}));
///
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) {

@ -51,8 +51,11 @@ class ConversationInfo {
/// s
int? burnDuration;
///
String? ext;
///
bool? isMsgDestruct;
/// s
int? msgDestructTime;
///
String? ex;
@ -78,7 +81,9 @@ class ConversationInfo {
this.isPinned,
this.isNotInGroup,
this.ex,
this.ext,
this.groupAtType,
this.isMsgDestruct,
this.msgDestructTime,
});
ConversationInfo.fromJson(Map<String, dynamic> json)
@ -106,7 +111,8 @@ class ConversationInfo {
isNotInGroup = json['isNotInGroup'];
groupAtType = json['groupAtType'];
ex = json['ex'];
ext = json['ext'];
isMsgDestruct = json['isMsgDestruct'];
msgDestructTime = json['msgDestructTime'];
}
Map<String, dynamic> toJson() {
@ -129,7 +135,8 @@ class ConversationInfo {
data['isNotInGroup'] = this.isNotInGroup;
data['groupAtType'] = this.groupAtType;
data['ex'] = this.ex;
data['ext'] = this.ext;
data['isMsgDestruct'] = this.isMsgDestruct;
data['msgDestructTime'] = this.msgDestructTime;
return data;
}

@ -23,7 +23,7 @@ class MeetingInfoList {
}
class MeetingInfo {
String? meetingID;
String? roomID;
String? meetingName;
String? ex;
String? hostUserID;
@ -46,7 +46,7 @@ class MeetingInfo {
List<String>? beWatchedUserIDList; //
MeetingInfo({
this.meetingID,
this.roomID,
this.meetingName,
this.ex,
this.hostUserID,
@ -70,7 +70,7 @@ class MeetingInfo {
});
MeetingInfo.fromJson(Map<String, dynamic> json) {
meetingID = json['meetingID'];
roomID = json['roomID'];
meetingName = json['meetingName'];
ex = json['ex'];
hostUserID = json['hostUserID'];
@ -107,7 +107,7 @@ class MeetingInfo {
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['meetingID'] = meetingID;
data['roomID'] = roomID;
data['meetingName'] = meetingName;
data['ex'] = ex;
data['hostUserID'] = hostUserID;
@ -133,21 +133,21 @@ class MeetingInfo {
}
class MeetingStreamEvent {
String? meetingID;
String? roomID;
String? streamType;
bool? mute;
MeetingStreamEvent({this.meetingID, this.streamType, this.mute});
MeetingStreamEvent({this.roomID, this.streamType, this.mute});
MeetingStreamEvent.fromJson(Map<String, dynamic> json) {
meetingID = json['meetingID'];
roomID = json['roomID'];
streamType = json['streamType'];
mute = json['mute'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['meetingID'] = this.meetingID;
data['roomID'] = this.roomID;
data['streamType'] = this.streamType;
data['mute'] = this.mute;
return data;

@ -4,7 +4,7 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class SignalingInfo {
///
String? opUserID;
String? userID;
///
InvitationInfo? invitation;
@ -13,24 +13,24 @@ class SignalingInfo {
OfflinePushInfo? offlinePushInfo;
SignalingInfo({
this.opUserID,
this.userID,
this.invitation,
this.offlinePushInfo,
});
SignalingInfo.fromJson(Map<String, dynamic> json) {
opUserID = json['opUserID'];
invitation = json['invitation'] == null
? null
: InvitationInfo.fromJson(json['invitation']);
offlinePushInfo = json['offlinePushInfo'] == null
? null
: OfflinePushInfo.fromJson(json['offlinePushInfo']);
userID = json['userID'] ?? invitation?.inviterUserID;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['opUserID'] = this.opUserID;
data['userID'] = this.userID;
data['invitation'] = this.invitation?.toJson();
data['offlinePushInfo'] = this.offlinePushInfo?.toJson();
return data;
@ -78,7 +78,7 @@ class InvitationInfo {
InvitationInfo.fromJson(Map<String, dynamic> json) {
inviterUserID = json['inviterUserID'];
inviteeUserIDList = json['inviteeUserIDList'].cast<String>();
inviteeUserIDList = json['inviteeUserIDList']?.cast<String>();
groupID = json['groupID'];
roomID = json['roomID'];
timeout = json['timeout'];

Loading…
Cancel
Save