/// <summary> /// 方法说明:获取接收到的平台SDK聊天消息,转化为触角SDK聊天消息 /// </summary> /// <param name="entity">SDK聊天信息</param> /// <returns>触角SDK聊天信息</returns> internal static OtherBase GetAntSdkReceivedOther(MsSdkOther.SdkOtherBase entity) { try { //符合标准聊天消息结构处理的部分,走此方法处理,预留 //返回空 return(null); } catch (Exception ex) { LogHelper.WriteError( $"[AntSdkChatMsg.GetAntSdkReceivedOther]:{Environment.NewLine}{ex.Message}{ex.StackTrace}"); return(null); } }
/// <summary> /// 方法说明:触角SDK聊天消息和SDK聊天消息转换 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entity"></param> /// <returns></returns> private static T GetAntSdkReceivedOtherBase <T>(MsSdkOther.SdkOtherBase entity) where T : OtherBase, new() { var sdkreceivemsgtypeValue = (long)entity.MsgType; var antsdkreceivemsgType = (AntSdkMsgType)sdkreceivemsgtypeValue; var result = new T { MsgType = antsdkreceivemsgType, sessionId = entity.sessionId, chatIndex = entity.chatIndex, chatType = entity.chatType, flag = entity.flag, os = entity.os, status = entity.status, messageId = entity.messageId, sendUserId = entity.sendUserId, targetId = entity.targetId, sendTime = entity.sendTime, attr = entity.attr, sourceContent = entity.sourceContent }; return(result); }
/// <summary> /// 方法说明:SDK发送其他消息(结构是聊天消息的标准结构) /// 完成时间:2015-05-16 /// </summary> /// <param name="otherMsg">发送的其他消息实体</param> /// <param name="errorMsg">错误提示</param> /// <returns>是否成功发其他标准消息</returns> public bool SdkPublishOtherMsg(MsSdkOther.SdkOtherBase otherMsg, ref string errorMsg) { var jsonStr = MsgConverter.GetJsonByOtherMsg(otherMsg, ref errorMsg); return(!string.IsNullOrEmpty(jsonStr) && Publish(TopicSend.sdk_send.ToString(), jsonStr, false, ref errorMsg)); }