예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="product"></param>
        /// <returns>
        /// code=0:保存失败
        /// code=200:保存成功
        /// data=0:产品Id
        /// </returns>
        public string SaveProduct(ProductRequest product)
        {
            var url = $"{apiDomain}/api/Proxy/SaveProduct";
            Dictionary <String, string> postParameters = new Dictionary <string, string>();

            postParameters.Add("product", product.ToJson());
            var postData = SignatureHelper.ConvertSignString(postParameters, AccessKeyId, AccessKeySecret);

            var result = httpHelper.GetHtml(new HttpItem()
            {
                URL         = url,
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded",//返回类型    可选项有默认值
                Postdata    = postData,
            });

            return(result.Html);
        }
예제 #2
0
        public string GetMemberDomainList(long memberInfo_id)
        {
            var url = $"{apiDomain}/api/Proxy/GetMemberDomainList";
            Dictionary <String, string> postParameters = new Dictionary <string, string>();

            postParameters.Add("memberinfo_id", memberInfo_id.ToStr());

            var postData = SignatureHelper.ConvertSignString(postParameters, AccessKeyId, AccessKeySecret);

            var result = httpHelper.GetHtml(new HttpItem()
            {
                URL         = url,
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded",
                Postdata    = postData,
            });

            return(result.Html);
        }
예제 #3
0
        /// <summary>
        /// 创建一个免费会员会员账号
        /// </summary>
        /// <param name="accountName">
        /// 1、账号长度6-20字符
        /// 2、账号只能是小写字母或数字
        /// 3、账号不能是11位纯数字
        /// 4、账号结尾不能含有\"wap\"字样(持续更新)
        /// </param>
        /// <param name="password">
        /// 1、接口密码需要明文
        /// 2、密码由8-20个字符组成,区分大小写
        /// 3、密码必须包含字母和数字
        /// </param>
        /// <returns>
        /// 返回会员Id
        /// </returns>
        public string CreateMemberAccount(string accountName, string password)
        {
            Dictionary <String, string> postParameters = new Dictionary <string, string>();

            postParameters.Add("accountName", accountName);
            postParameters.Add("password", password);

            var url      = $"{apiDomain}/api/Proxy/CreateMemberAccount";
            var postData = SignatureHelper.ConvertSignString(postParameters, AccessKeyId, AccessKeySecret);

            var result = httpHelper.GetHtml(new HttpItem()
            {
                URL         = url,
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded",//返回类型    可选项有默认值
                Postdata    = postData
            });

            return(result.Html);
        }
예제 #4
0
        /// <summary>
        /// 获取网站模板列表
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="pageSize">数量</param>
        /// <returns></returns>
        public string GetWebsiteTemplateList(int page, int pageSize)
        {
            Dictionary <String, string> postParameters = new Dictionary <string, string>();

            postParameters.Add("page", page.ToStr());
            postParameters.Add("pagesize", pageSize.ToStr());

            var url      = $"{apiDomain}/api/Proxy/GetWebsiteTemplateList";
            var postData = SignatureHelper.ConvertSignString(postParameters, AccessKeyId, AccessKeySecret);

            var result = httpHelper.GetHtml(new HttpItem()
            {
                URL         = url,
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded",//返回类型    可选项有默认值
                Postdata    = postData
            });

            return(result.Html);
        }
예제 #5
0
        /// <summary>
        /// 设置会员级别
        /// </summary>
        /// <param name="memberInfo_Id"></param>
        /// <param name="memberLevel"></param>
        /// <param name="openTime">开通时间</param>
        /// <param name="expireTime">到期时间</param>
        /// <returns>
        /// code=0:设置失败
        /// code=200:设置成功
        /// </returns>
        public string SetMemberLevel(long memberInfo_Id, CMSMemberLevelEnum memberLevel, DateTime openTime, DateTime expireTime)
        {
            Dictionary <String, string> postParameters = new Dictionary <string, string>();

            postParameters.Add("memberInfo_id", memberInfo_Id.ToStr());
            postParameters.Add("memberLevel", ((int)memberLevel).ToStr());

            postParameters.Add("opentime", openTime.ToDateTimeStr());
            postParameters.Add("expiretime", expireTime.ToDateTimeStr());

            var url      = $"{apiDomain}/api/Proxy/SetMemberLevel";
            var postData = SignatureHelper.ConvertSignString(postParameters, AccessKeyId, AccessKeySecret);

            var result = httpHelper.GetHtml(new HttpItem()
            {
                URL         = url,
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded",
                Postdata    = postData
            });

            return(result.Html);
        }