Example #1
0
        public IStreamImplementation GetMsgStreamImpl(TopCometStreamRequest cometReq)
        {
            if (cometReq != null)
            {
                cometReq.GetConnectListener().OnBeforeConnect();
            }

            TopDictionary param = new TopDictionary();
            param.Add(StreamConstants.PARAM_APPKEY, cometReq.GetAppkey());
            if (!String.IsNullOrEmpty(cometReq.GetUserId()))
            {
                param.Add(StreamConstants.PARAM_USERID, cometReq.GetUserId());
            }
            if (!String.IsNullOrEmpty(cometReq.GetConnectId()))
            {
                param.Add(StreamConstants.PARAM_CONNECT_ID, cometReq.GetConnectId());
            }
            param.Add(StreamConstants.PARAM_TIMESTAMP, DateTime.Now.Ticks);

            IDictionary<string, string> otherParam = cometReq.GetOtherParam();
            if (otherParam != null && otherParam.Count > 0)
            {
                IEnumerator<KeyValuePair<string, string>> kvps = otherParam.GetEnumerator();
                while (kvps.MoveNext())
                {
                    param.Add(kvps.Current.Key, kvps.Current.Value);
                }
            }

            string sign = null;
            try
            {
                sign = TopUtils.SignTopRequest(param, cometReq.GetSecret(), true);
                if (String.IsNullOrEmpty(sign))
                {
                    throw new Exception("Get sign error");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            param.Add(StreamConstants.PARAM_SIGN, sign);
            HttpClient httpClient = new HttpClient(conf, param);
            HttpResponse response;
            response = httpClient.Post();
            return currentStreamImpl = new MessageStreamImpl(msgConsumeFactory, response, cometMessageListener, this);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("appDesc", this.AppDesc);
            parameters.Add("appIcon", this.AppIcon);
            parameters.Add("appName", this.AppName);
            parameters.Add("homepageUrl", this.HomepageUrl);
            parameters.Add("ompLink", this.OmpLink);
            parameters.Add("pcHomepageUrl", this.PcHomepageUrl);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("fields", this.Fields);
            parameters.Add("page_no", this.PageNo);
            parameters.Add("page_size", this.PageSize);
            parameters.Add("seller_nick", this.SellerNick);
            parameters.Add("status", this.Status);
            parameters.Add("type", this.Type);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("contain_access_limit", this.ContainAccessLimit);
            parameters.Add("cursor", this.Cursor);
            parameters.Add("dept_id", this.DeptId);
            parameters.Add("language", this.Language);
            parameters.Add("order_field", this.OrderField);
            parameters.Add("size", this.Size);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #5
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("extend", this.Extend);
            parameters.Add("rec_num", this.RecNum);
            parameters.Add("sms_free_sign_name", this.SmsFreeSignName);
            parameters.Add("sms_param", this.SmsParam);
            parameters.Add("sms_template_code", this.SmsTemplateCode);
            parameters.Add("sms_type", this.SmsType);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("end_date", this.EndDate);
            parameters.Add("msg_code", this.MsgCode);
            parameters.Add("page_no", this.PageNo);
            parameters.Add("page_size", this.PageSize);
            parameters.Add("start_date", this.StartDate);
            parameters.Add("status", this.Status);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("anony", this.Anony);
            parameters.Add("content", this.Content);
            parameters.Add("oid", this.Oid);
            parameters.Add("result", this.Result);
            parameters.Add("role", this.Role);
            parameters.Add("tid", this.Tid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("cursor", this.Cursor);
            parameters.Add("end_time", this.EndTime);
            parameters.Add("process_code", this.ProcessCode);
            parameters.Add("size", this.Size);
            parameters.Add("start_time", this.StartTime);
            parameters.Add("userid_list", this.UseridList);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("biz_code", this.BizCode);
            parameters.Add("deliver_channel", this.DeliverChannel);
            parameters.Add("deliver_msg", this.DeliverMsg);
            parameters.Add("deliver_outer_id", this.DeliverOuterId);
            parameters.Add("deliver_status", this.DeliverStatus);
            parameters.Add("job_id", this.JobId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("cursor", this.Cursor);
            parameters.Add("end_time", this.EndTime);
            parameters.Add("size", this.Size);
            parameters.Add("start_time", this.StartTime);
            parameters.Add("template_name", this.TemplateName);
            parameters.Add("userid", this.Userid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("activity_id", this.ActivityId);
            parameters.Add("adzone_id", this.AdzoneId);
            parameters.Add("page_no", this.PageNo);
            parameters.Add("page_size", this.PageSize);
            parameters.Add("settle_month", this.SettleMonth);
            parameters.Add("site_id", this.SiteId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #12
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("course_code", this.CourseCode);
            parameters.Add("op_userid", this.OpUserid);
            parameters.Add("participant_corpid", this.ParticipantCorpid);
            parameters.Add("participant_id", this.ParticipantId);
            parameters.Add("participant_type", this.ParticipantType);
            parameters.Add("role", this.Role);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #13
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("batch_id", this.BatchId);
            parameters.Add("batch_index", this.BatchIndex);
            parameters.Add("conference_id", this.ConferenceId);
            parameters.Add("is_finished", this.IsFinished);
            parameters.Add("participant_userid_list", this.ParticipantUseridList);
            parameters.Add("userid", this.Userid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("content", this.Content);
            parameters.Add("customerid", this.Customerid);
            parameters.Add("msgtype", this.Msgtype);
            parameters.Add("serviceid", this.Serviceid);
            parameters.Add("token", this.Token);
            parameters.Add("userid", this.Userid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("isv_ext", this.IsvExt);
            parameters.Add("item_id", this.ItemId);
            parameters.Add("mix_buyer_nick", this.MixBuyerNick);
            parameters.Add("seller_nick", this.SellerNick);
            parameters.Add("sku_id", this.SkuId);
            parameters.Add("trace_id", this.TraceId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("api", this.Api);
            parameters.Add("biz_ext_string", this.BizExtString);
            parameters.Add("mix_user_nick", this.MixUserNick);
            parameters.Add("safety", this.Safety);
            parameters.Add("ticket", this.Ticket);
            parameters.Add("trace_id", this.TraceId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #17
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("attachment", this.Attachment);
            parameters.Add("creator_userid", this.CreatorUserid);
            parameters.Add("receiver_userids", this.ReceiverUserids);
            parameters.Add("remind_time", this.RemindTime);
            parameters.Add("remind_type", this.RemindType);
            parameters.Add("text_content", this.TextContent);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #18
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("id", this.Id);
            parameters.Add("is_major", this.IsMajor);
            parameters.Add("is_rectangle", this.IsRectangle);
            parameters.Add("num_iid", this.NumIid);
            parameters.Add("pic_path", this.PicPath);
            parameters.Add("position", this.Position);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #19
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("is_return_goods", this.IsReturnGoods);
            parameters.Add("is_return_post_fee", this.IsReturnPostFee);
            parameters.Add("refund_desc", this.RefundDesc);
            parameters.Add("refund_reason_id", this.RefundReasonId);
            parameters.Add("return_fee", this.ReturnFee);
            parameters.Add("sub_order_id", this.SubOrderId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #20
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("app_id", this.AppId);
            parameters.Add("biz_no", this.BizNo);
            parameters.Add("icon", this.Icon);
            parameters.Add("name", this.Name);
            parameters.Add("pc_shortcut_uri", this.PcShortcutUri);
            parameters.Add("shortcut_uri", this.ShortcutUri);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #21
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("isforce", this.Isforce);
            parameters.Add("item_barcode", this.ItemBarcode);
            parameters.Add("item_id", this.ItemId);
            parameters.Add("sku_barcodes", this.SkuBarcodes);
            parameters.Add("sku_ids", this.SkuIds);
            parameters.Add("src", this.Src);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("context", this.Context);
            parameters.Add("order_id", this.OrderId);
            parameters.Add("rework_start_id", this.ReworkStartId);
            parameters.Add("tenant_id", this.TenantId);
            parameters.Add("to_inactive_ids", this.ToInactiveIds);
            parameters.Add("userid", this.Userid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("contact_name", this.ContactName);
            parameters.Add("contact_phone", this.ContactPhone);
            parameters.Add("contact_position_list", this.ContactPositionList);
            parameters.Add("creator_userid", this.CreatorUserid);
            parameters.Add("customer_instance_id", this.CustomerInstanceId);
            parameters.Add("provider_corpid", this.ProviderCorpid);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #24
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("called_num", this.CalledNum);
            parameters.Add("called_show_num", this.CalledShowNum);
            parameters.Add("caller_num", this.CallerNum);
            parameters.Add("caller_show_num", this.CallerShowNum);
            parameters.Add("extend", this.Extend);
            parameters.Add("session_time_out", this.SessionTimeOut);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("adzone_id", this.AdzoneId);
            parameters.Add("platform", this.Platform);
            parameters.Add("promotion_scene_id", this.PromotionSceneId);
            parameters.Add("relation_id", this.RelationId);
            parameters.Add("sub_pid", this.SubPid);
            parameters.Add("union_id", this.UnionId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #26
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("biz_id", this.BizId);
            parameters.Add("class_id", this.ClassId);
            parameters.Add("mobile", this.Mobile);
            parameters.Add("operator", this.Operator);
            parameters.Add("relation", this.Relation);
            parameters.Add("stu_id", this.StuId);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("agent_id", this.AgentId);
            parameters.Add("app_id", this.AppId);
            parameters.Add("duration", this.Duration);
            parameters.Add("file_ids", this.FileIds);
            parameters.Add("path", this.Path);
            parameters.Add("type", this.Type);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("cid", this.Cid);
            parameters.Add("customer_props", this.CustomerProps);
            parameters.Add("fields", this.Fields);
            parameters.Add("market_id", this.MarketId);
            parameters.Add("product_id", this.ProductId);
            parameters.Add("props", this.Props);
            if (this.OtherParams != null)
            {
                parameters.AddAll(this.OtherParams);
            }
            return(parameters);
        }
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("corp_id", this.CorpId);
            parameters.Add("order_by", this.OrderBy);
            parameters.Add("page_size", this.PageSize);
            parameters.Add("page_start", this.PageStart);
            parameters.Add("return_fields", this.ReturnFields);
            parameters.Add("stat_date", this.StatDate);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #30
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("ignorewarning", this.Ignorewarning);
            parameters.Add("item_num", this.ItemNum);
            parameters.Add("item_price", this.ItemPrice);
            parameters.Add("lang", this.Lang);
            parameters.Add("num_iid", this.NumIid);
            parameters.Add("properties", this.Properties);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
Example #31
0
        public override IDictionary <string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();

            parameters.Add("app_uuid", this.AppUuid);
            parameters.Add("current_operator_userid", this.CurrentOperatorUserid);
            parameters.Add("cursor", this.Cursor);
            parameters.Add("form_code", this.FormCode);
            parameters.Add("query_dsl", this.QueryDsl);
            parameters.Add("size", this.Size);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return(parameters);
        }
 public IStreamImplementation GetMsgStreamImpl(TopCometStreamRequest cometReq)
 {
     if (cometReq != null)
     {
         cometReq.GetConnectListener().OnBeforeConnect();
     }
     TopDictionary parameters = new TopDictionary();
     parameters.Add("app_key", cometReq.GetAppkey());
     if (!string.IsNullOrEmpty(cometReq.GetUserId()))
     {
         parameters.Add("user", cometReq.GetUserId());
     }
     if (!string.IsNullOrEmpty(cometReq.GetConnectId()))
     {
         parameters.Add("id", cometReq.GetConnectId());
     }
     parameters.Add("timestamp", DateTime.Now.Ticks);
     IDictionary<string, string> otherParam = cometReq.GetOtherParam();
     if ((otherParam != null) && (otherParam.Count > 0))
     {
         IEnumerator<KeyValuePair<string, string>> enumerator = otherParam.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair<string, string> current = enumerator.Current;
             KeyValuePair<string, string> pair2 = enumerator.Current;
             parameters.Add(current.Key, pair2.Value);
         }
     }
     string str = null;
     try
     {
         str = TopUtils.SignTopRequest(parameters, cometReq.GetSecret(), true);
         if (string.IsNullOrEmpty(str))
         {
             throw new Exception("Get sign error");
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
     parameters.Add("sign", str);
     HttpResponse response = new HttpClient(this.conf, parameters).Post();
     return (this.currentStreamImpl = new MessageStreamImpl(this.msgConsumeFactory, response, this.cometMessageListener, this));
 }