Наследование: MBase
Пример #1
0
        /// <summary>
        ///     增加货架
        /// </summary>
        /// <param name="accessTokenOrAppId"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static AddShelfResult AddShelves(string accessTokenOrAppId, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5,
            string shelfBanner, string shelfName)
        {
            return ApiHandlerWapper.TryCommonApi(accessToken =>
            {
                var urlFormat = "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}";
                var data = new
                {
                    shelf_data = new
                    {
                        module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                    },
                    shelf_banner = shelfBanner,
                    shelf_name = shelfName
                };
                return CommonJsonSend.Send<AddShelfResult>(accessToken, urlFormat, data);
            }, accessTokenOrAppId);

            //var urlFormat = "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}";

            //var data = new
            //{
            //    shelf_data = new
            //    {
            //        module_infos = new object[]
            //        {
            //            m1,
            //            m2,
            //            m3,
            //            m4,
            //            m5
            //        }
            //    },
            //    shelf_banner = shelfBanner,
            //    shelf_name = shelfName
            //};

            //return CommonJsonSend.Send<AddShelfResult>(accessToken, urlFormat, data);
        }
Пример #2
0
         /// <summary>
        /// 增加货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static AddShelfResult AddShelves(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}";

            var data = new
                {
                    shelf_data = new
                        {
                            module_infos = new object[]
                                {
                                    m1,
                                    m2,
                                    m3,
                                    m4,
                                    m5
                                }
                        },
                    shelf_banner = shelfBanner,
                    shelf_name = shelfName
                };
            
            return CommonJsonSend.Send<AddShelfResult>(accessToken, urlFormat, data);
        }
Пример #3
0
        public static AddShelfResult AddShelves(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, string shelfBanner, string shelfName)
        {
            var urlFormat = Config.ApiMpHost + "/merchant/shelf/add?access_token={0}";

            var data = new
            {
                shelf_data = new
                {
                    module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                },
                shelf_banner = shelfBanner,
                shelf_name   = shelfName
            };

            return(CommonJsonSend.Send <AddShelfResult>(accessToken, urlFormat, data));
        }
Пример #4
0
        public static async Task <WxJsonResult> ModShelvesAsync(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, int shelfId, string shelfBanner, string shelfName)
        {
            var urlFormat = Config.ApiMpHost + "/merchant/shelf/mod?access_token={0}";

            var data = new
            {
                shelf_id   = shelfId,
                shelf_data = new
                {
                    module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                },
                shelf_banner = shelfBanner,
                shelf_name   = shelfName
            };

            return(await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync <WxJsonResult>(accessToken, urlFormat, data).ConfigureAwait(false));
        }
Пример #5
0
        /// <summary>
        /// 修改货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfId">货架Id</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static WxJsonResult ModShelves(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, int shelfId, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/mod?access_token={0}";

            var data = new
            {
                shelf_id   = shelfId,
                shelf_data = new
                {
                    module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                },
                shelf_banner = shelfBanner,
                shelf_name   = shelfName
            };

            return(CommonJsonSend.Send <WxJsonResult>(accessToken, urlFormat, data));
        }
Пример #6
0
        /// <summary>
        /// 【异步方法】增加货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static async Task <AddShelfResult> AddShelvesAsync(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}";

            var data = new
            {
                shelf_data = new
                {
                    module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                },
                shelf_banner = shelfBanner,
                shelf_name   = shelfName
            };

            return(await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync <AddShelfResult>(accessToken, urlFormat, data));
        }
Пример #7
0
        /// <summary>
        /// 【异步方法】修改货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfId">货架Id</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static async Task<WxJsonResult> ModShelvesAsync(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, int shelfId, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/mod?access_token={0}";

            var data = new
            {
                shelf_id = shelfId,
                shelf_data = new
                {
                    module_infos = new object[]
                                {
                                    m1,
                                    m2,
                                    m3,
                                    m4,
                                    m5
                                }
                },
                shelf_banner = shelfBanner,
                shelf_name = shelfName
            };

            return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync<WxJsonResult>(accessToken, urlFormat, data);
        }