feat: Optimize comments and field names.

This commit is contained in:
std-s
2023-10-12 15:01:38 +08:00
parent cc6d164985
commit 627ee54a67
40 changed files with 1126 additions and 1753 deletions

View File

@@ -1,14 +1,15 @@
/// 会话类型
/// Conversation types
class ConversationType {
/// 单聊
/// Single chat
static const single = 1;
///
/// Group (Deprecated in v3)
@Deprecated('Use superGroup instead')
static const group = 2;
/// 大群
/// Super group chat
static const superGroup = 3;
/// 通知
/// Notification
static const notification = 4;
}

View File

@@ -1,17 +1,17 @@
/// 会话强提示内容
/// Conversation Strong Hint Content
class GroupAtType {
/// 取消所有提示,即调用了resetConversationGroupAtType方法
/// Cancel all hints, equivalent to calling the resetConversationGroupAtType method
static const atNormal = 0;
/// @了我提示
/// @ me hint
static const atMe = 1;
/// @了所有人提示
/// @ all hint
static const atAll = 2;
/// @了所有人@了我
/// @ all and @ me hint
static const atAllAtMe = 3;
/// 群公告提示
/// Group notification hint
static const groupNotification = 4;
}

View File

@@ -1,11 +1,11 @@
/// 群成员角色
/// Group Member Roles
class GroupRoleLevel {
/// 群主
/// Group owner
static const owner = 100;
/// 管理员
/// Administrator
static const admin = 60;
/// 普通成员
/// Regular member
static const member = 20;
}

View File

@@ -1,8 +1,9 @@
/// 组类型
/// Group Types
class GroupType {
/// 普通群
/// General group (Deprecated in v3)
@Deprecated('Use work instead')
static const int general = 0;
/// 工作群
/// Work group
static const int work = 2;
}

View File

@@ -1,11 +1,11 @@
/// 进群验证设置选项
/// Group Join Verification Settings
class GroupVerification {
/// 申请需要同意 邀请直接进
/// Apply and invite directly for entry
static const int applyNeedVerificationInviteDirectly = 0;
/// 所有人进群需要验证,除了群主管理员邀
/// Everyone needs verification to join, except for group owners and administrators who can invite directly
static const int allNeedVerification = 1;
/// 直接进群
/// Directly join the group
static const int directly = 2;
}

View File

@@ -1,15 +1,16 @@
/// 当前flutter平台仅支持Android/ios
/// The current Flutter platform supports only Android/iOS
class IMPlatform {
/// IOS
/// iOS
static const ios = 1;
/// Android
static const android = 2;
static const windows = 3;
static const xos = 4;
static const web = 5;
static const mini_web = 6;
static const miniWeb = 6;
static const linux = 7;
static const android_pad = 8;
static const androidPad = 8;
static const ipad = 9;
}

View File

@@ -1,4 +1,4 @@
/// callback类型
/// Callback Types
class ListenerType {
static const simpleMsgListener = 'simpleMsgListener';
static const connectListener = 'connectListener';

View File

@@ -1,14 +1,14 @@
/// 消息发送状态
/// Message Send Status
class MessageStatus {
/// 发送中
/// Sending
static const sending = 1;
/// 已发送成功
/// Successfully sent
static const succeeded = 2;
/// 发送失败
/// Send failed
static const failed = 3;
/// 已经删除
/// Already deleted
static const deleted = 4;
}

View File

@@ -1,171 +1,179 @@
/// 消息类型
/// Message Types
class MessageType {
/// 普通文本
/// Normal text
static const text = 101;
/// 图片
/// Picture
static const picture = 102;
/// 语音
/// Voice
static const voice = 103;
/// 视频
/// Video
static const video = 104;
/// 文件
/// File
static const file = 105;
/// @消息
static const at_text = 106;
/// @ Message
static const atText = 106;
/// 合并
/// Merge
static const merger = 107;
/// 名片
/// Business Card
static const card = 108;
/// 位置
/// Location
static const location = 109;
/// 自定义
/// Custom
static const custom = 110;
/// 已读回执
static const has_read_receipt = 112;
/// Has Read Receipt
static const hasReadReceipt = 112;
/// 正字输入
/// Typing
static const typing = 113;
/// 引用回复
/// Quote Reply
static const quote = 114;
/// 自定义表情
static const custom_face = 115;
/// Custom Emoji
static const customFace = 115;
/// 群消息已读回执
/// Group Message Has Read Receipt (Deprecated in v3)
@Deprecated('Use GroupHasReadReceiptNotification instead')
static const groupHasReadReceipt = 116;
/// 富文本消息
/// Rich Text Message
static const advancedText = 117;
static const customMsgNotTriggerConversation = 119;
static const customMsgOnlineOnly = 120;
/// 通知类型
/// Notification Types
static const notificationBegin = 1000;
static const friendNotificationBegin = 1200;
/// 好友申请已接受
/// Friend Request Accepted
static const friendApplicationApprovedNotification = 1201;
/// 好友申请已拒绝
/// Friend Request Rejected
static const friendApplicationRejectedNotification = 1202;
/// 好友申请
/// Friend Request
static const friendApplicationNotification = 1203;
/// 好友已添加
/// Friend Added
static const friendAddedNotification = 1204;
/// 好友已删除
/// Friend Deleted
static const friendDeletedNotification = 1205;
/// 设置好友备注
/// Set Friend Remark
static const friendRemarkSetNotification = 1206;
/// 好友加入黑名单
/// Friend Added to Blacklist
static const blackAddedNotification = 1207;
/// 已从黑名单移除
/// Removed from Blacklist
static const blackDeletedNotification = 1208;
static const friendNotificationEnd = 1299;
/// 会话改变
/// Conversation Change
static const conversationChangeNotification = 1300;
static const userNotificationBegin = 1301;
/// 用户信息改变
/// User Information Changed
static const userInfoUpdatedNotification = 1303;
static const userNotificationEnd = 1399;
/// OA通知
/// OA Notification
static const oaNotification = 1400;
static const groupNotificationBegin = 1500;
/// 群已被创建
/// Group Created
static const groupCreatedNotification = 1501;
/// 群资料改变
/// Group Info Set
static const groupInfoSetNotification = 1502;
/// 进群申请
/// Join Group Application
static const joinGroupApplicationNotification = 1503;
/// 群成员退出
/// Group Member Quit
static const memberQuitNotification = 1504;
/// 群申请被接受
/// Group Application Accepted
static const groupApplicationAcceptedNotification = 1505;
/// 群申请被拒绝
/// Group Application Rejected
static const groupApplicationRejectedNotification = 1506;
/// 群拥有者权限转移
/// Group Owner Transferred
static const groupOwnerTransferredNotification = 1507;
/// 群成员被踢出群
/// Member Kicked from Group
static const memberKickedNotification = 1508;
/// 邀请进群
/// Member Invited to Group
static const memberInvitedNotification = 1509;
/// 群成员进群
/// Member Entered Group
static const memberEnterNotification = 1510;
/// 解散群
/// Dismiss Group
static const dismissGroupNotification = 1511;
static const groupNotificationEnd = 1599;
/// 群成员被禁言
/// Group Member Muted
static const groupMemberMutedNotification = 1512;
/// 群成员被取消禁言
/// Group Member Cancel Muted
static const groupMemberCancelMutedNotification = 1513;
/// 群禁言
/// Group Muted
static const groupMutedNotification = 1514;
/// 取消群禁言
/// Cancel Group Muted
static const groupCancelMutedNotification = 1515;
/// 群成员信息改变
/// Group Member Information Changed
static const groupMemberInfoChangedNotification = 1516;
/// 群公告修改
/// Group Member Set to Admin
static const groupMemberSetToAdminNotification = 1517;
static const groupMemberSetToOrdinaryUserNotification = 1518;
/// Group Notice Changed
static const groupNoticeChangedNotification = 1519;
/// 群名字修改
/// Group Name Changed
static const groupNameChangedNotification = 1520;
static const signalingNotificationBegin = 1600;
/// 信令
static const signalingNotification = 1601;
static const signalingNotificationEnd = 1699;
/// 阅后即焚
/// Burn After Reading
static const burnAfterReadingNotification = 1701;
static const notificationEnd = 2000;
/// 撤回消息
/// Business Notification
static const businessNotification = 2001;
/// Recall Message
static const revokeMessageNotification = 2101;
/// Single Chat Has Read Receipt
static const signalHasReadReceiptNotification = 2150;
/// Group Chat Has Read Receipt
static const groupHasReadReceiptNotification = 2155;
}

View File

@@ -1,172 +1,155 @@
// /// 消息发送失败
// class MessageFailedCode {
// /// 被对方拉黑
// static const int blockedByFriend = 1302;
//
// /// 被对方删除
// static const int deletedByFriend = 1303;
//
// /// 已被移除群聊/群已解散
// static const int notInGroup = 1204;
// }
//
// /// 添加好友失败
// class AddFriendFailedCode {
// /// 该用户已设置不可添加
// static const int refuseToAddFriends = 10013;
// }
/// SDK Error Codes
class SDKErrorCode {
/// 网络请求错误
/// Network Request Error
static const int networkRequestError = 10000;
/// 网络等待超时错误
/// Network Waiting Timeout Error
static const int networkWaitTimeoutError = 10001;
/// 参数错误
/// Parameter Error
static const int parameterError = 10002;
/// 上下文超时错误,通常为用户已经退出
/// Context Timeout Error, usually when the user has already logged out
static const int contextTimeoutError = 10003;
/// 资源未加载完毕,通常为未初始化,或者登录接口还未成功返回
/// Resources not loaded completely, usually uninitialized or login hasn't completed
static const int resourceNotLoaded = 10004;
/// 未知错误,需要根据 errmsg 确认原因
/// Unknown Error, check the error message for details
static const int unknownError = 10005;
/// sdk 内部错误,需要根据 errmsg 确认原因
/// SDK Internal Error, check the error message for details
static const int sdkInternalError = 10006;
/// 该用户已设置不可添加
/// This user has set not to be added
static const int refuseToAddFriends = 10013;
/// 用户不存在或未注册
/// User does not exist or is not registered
static const int userNotExistOrNotRegistered = 10100;
/// 用户已经退出登录
/// User has already logged out
static const int userHasLoggedOut = 10101;
/// 用户重复登录,可以通过 getloginstatus 确认登录状态,避免重复登录
/// User is attempting to log in again, check the login status to avoid duplicate logins
static const int repeatLogin = 10102;
/// 需要上传的文件不存在
/// The file to upload does not exist
static const int uploadFileNotExist = 10200;
/// 消息解压失败
/// Message decompression failed
static const int messageDecompressionFailed = 10201;
/// 消息解码失败
/// Message decoding failed
static const int messageDecodingFailed = 10202;
/// 不支持的长连接二进制协议
/// Unsupported long connection binary protocol
static const int unsupportedLongConnection = 10203;
/// 消息重复发送
/// Message sent multiple times
static const int messageRepeated = 10204;
/// 消息内容类型不支持
/// Message content type not supported
static const int messageContentTypeNotSupported = 10205;
/// 不支持的会话操作
/// Unsupported session operation
static const int unsupportedSessionOperation = 10301;
/// 群 ID 不存在
/// Group ID does not exist
static const int groupIDNotExist = 10400;
/// 群组类型错误
/// Group type is incorrect
static const int wrongGroupType = 10401;
/// 服务器内部错误,通常为内部网络错误,需要检查服务器各节点运行是否正常
/// Server Internal Error, usually an internal network error, check if server nodes are running correctly
static const int serverInternalError = 500;
/// 参数错误,需要检查 body 参数以及 header 参数是否正确
/// Parameter Error on the server, check if body and header parameters are correct
static const int serverParameterError = 1001;
/// 权限不足,一般为 header 参数中携带 token 不正确,或者权限越级操作
/// Insufficient Permissions, typically when the token in the header is incorrect or when trying to perform unauthorized actions
static const int insufficientPermissions = 1002;
/// 数据库主键重复
/// Duplicate Database Primary Key
static const int duplicateDatabasePrimaryKey = 1003;
/// 数据库记录未找到
/// Database Record Not Found
static const int databaseRecordNotFound = 1004;
/// 用户 ID 不存在
/// User ID does not exist
static const int userIDNotExist = 1101;
/// 用户已经注册
/// User is already registered
static const int userAlreadyRegistered = 1102;
/// 群不存在
/// Group does not exist
static const int groupNotExis = 1201;
/// 群已存在
/// Group already exists
static const int groupAlreadyExists = 1202;
/// 用户不在群组中
/// User is not in the group
static const int userIsNotInGroup = 1203;
/// 群组已解散
/// Group has been disbanded
static const int groupDisbanded = 1204;
/// 群申请已经被处理,不需要重复处理
/// Group application has already been processed, no need to process it again
static const int groupApplicationHasBeenProcessed = 1206;
/// 不能添加自己为好友
/// Cannot add yourself as a friend
static const int notAddMyselfAsAFriend = 1301;
/// 已被对方拉黑
/// You have been blocked by the other party
static const int hasBeenBlocked = 1302;
/// 对方不是自己的好友
/// The other party is not your friend
static const int notFriend = 1303;
/// 已经是好友关系,不需要重复申请
/// Already in a friend relationship, no need to reapply
static const int alreadyAFriendRelationship = 1304;
/// 消息已读功能被关闭
/// Message read function is turned off
static const int messageReadFunctionIsTurnedOff = 1401;
/// 你已被禁言,不能在群里发言
/// You have been banned from speaking in the group
static const int youHaveBeenBanned = 1402;
/// 群已被禁言,不能发言
/// The group has been banned from posting
static const int groupHasBeenBanned = 1403;
/// 该消息已被撤回
/// This message has been retracted
static const int messageHasBeenRetracted = 1404;
/// 授权过期
/// Authorization has expired
static const int licenseExpired = 1405;
/// token 已经过期
/// Token has expired
static const int tokenHasExpired = 1501;
/// token 无效
/// Invalid token
static const int tokenInvalid = 1502;
/// token 格式错误
/// Token format error
static const int tokenFormatError = 1503;
/// token 还未生效
/// Token has not yet taken effect
static const int tokenHasNotYetTakenEffect = 1504;
/// 未知 token 错误
/// Unknown token error
static const int unknownTokenError = 1505;
/// 被踢出的 token无效
/// The kicked-out token is invalid
static const int thekickedOutTokenIsInvalid = 1506;
/// token 不存在
/// Token does not exist
static const int tokenNotExist = 1507;
/// 连接数超过网关最大限制
/// Number of Connections Exceeds Gateway's Maximum Limit
static const int connectionsExceedsMaximumLimit = 1601;
/// 连接握手参数错误
/// Handshake Parameter Error
static const int handshakeParameterError = 1602;
/// 文件上传过期
/// File Upload Expired
static const int fileUploadExpired = 1701;
}