Ejemplo n.º 1
0
        /// <summary>
        /// 生成极光推送的扩展参数
        /// </summary>
        /// <param name="terminalType"></param>
        /// <param name="noticeMessage"></param>
        /// <param name="pageArgs"></param>
        /// <returns></returns>
        Dictionary <string, object> _GetJMessageExtras(EnumTerminalType terminalType, RequestNoticeMessageDTO noticeMessage, string pageArgs)
        {
            var dic = new Dictionary <string, object>();


            #region 处理兼容问题(老的APP应用通知类型长度)
            var NoticeType = ((int)noticeMessage.NoticeSecondType).ToString().PadLeft(7, '0');
            var MsgType    = int.Parse(NoticeType.Substring(4, 3));

            //通知类型是20以下的都需要处理成兼容,后续的类型在20以上
            if (MsgType <= 20)
            {
                //老的类型需要兼容
                dic.Add("MsgType", MsgType);
            }
            else
            {
                dic.Add("MsgType", NoticeType);
            }
            #endregion
            dic.Add("NoticeType", NoticeType);
            dic.Add("MsgID", noticeMessage.MessageID);
            dic.Add("PageArgs", pageArgs);
            var model = GetMessageExtrasConfig(terminalType, noticeMessage.NoticeSecondType);
            if (model != null)
            {
                dic.Add("PageType", model.PageType);
                dic.Add("PageUrl", model.PageUrl);
            }
            return(dic);
        }
Ejemplo n.º 2
0
        public RequestMessageExtrasConfigDTO GetMessageExtrasConfig(EnumTerminalType terminalType, EnumNoticeSecondType msgType)
        {
            var entity = GetAllExtrasConfig().Where(i => i.TerminalType == terminalType && i.MsgType == msgType).FirstOrDefault();

            return(entity);
        }