public HttpResponseMessage UpdateProductApproveStatus()
        {
            NameValueCollection       nameValueCollection       = base.Request.RequestUri.ParseQueryString();
            ProductApproveStatusParam productApproveStatusParam = new ProductApproveStatusParam();

            if (nameValueCollection.AllKeys.Contains("app_key"))
            {
                productApproveStatusParam.app_key = nameValueCollection["app_key"];
            }
            if (nameValueCollection.AllKeys.Contains("timestamp"))
            {
                productApproveStatusParam.timestamp = nameValueCollection["timestamp"];
            }
            if (nameValueCollection.AllKeys.Contains("sign"))
            {
                productApproveStatusParam.sign = nameValueCollection["sign"];
            }
            if (nameValueCollection.AllKeys.Contains("num_iid"))
            {
                productApproveStatusParam.num_iid = Convert.ToInt32(nameValueCollection["num_iid"]);
            }
            if (nameValueCollection.AllKeys.Contains("approve_status"))
            {
                productApproveStatusParam.approve_status = nameValueCollection["approve_status"];
            }
            string content = this._updateProductApproveStatus(productApproveStatusParam);

            return(new HttpResponseMessage
            {
                Content = new StringContent(content, Encoding.UTF8, "application/json")
            });
        }
        public HttpResponseMessage UpdateProductApproveStatus(ProductApproveStatusParam data)
        {
            string content = this._updateProductApproveStatus(data);

            return(new HttpResponseMessage
            {
                Content = new StringContent(content, Encoding.UTF8, "application/json")
            });
        }
        private string _updateProductApproveStatus(ProductApproveStatusParam data)
        {
            string result = "";

            if (this.CheckUpdateApproveStatusParameters(data, out result))
            {
                SiteSettings siteSettings = HiContext.Current.SiteSettings;
                string       text         = OpenApiSign.Sign(data.SignStr(siteSettings.CheckCode), "MD5", "utf-8");
                result = ((!text.Equals(data.sign)) ? OpenApiErrorMessage.ShowErrorMsg((Enum)(object)OpenApiErrorCode.Invalid_Signature, "sign") : this.lastUpdateProductApproveStatus(data.num_iid, data.approve_status));
            }
            return(result);
        }
 private bool CheckUpdateApproveStatusParameters(ProductApproveStatusParam parameter, out string result)
 {
     if (!OpenApiHelper.CheckSystemParameters(parameter.app_key, parameter.timestamp, parameter.sign, out result))
     {
         return(false);
     }
     if (parameter.num_iid <= 0)
     {
         result = OpenApiErrorMessage.ShowErrorMsg((Enum)(object)OpenApiErrorCode.Parameters_Format_Error, "num_iid");
         return(false);
     }
     parameter.approve_status = DataHelper.CleanSearchString(parameter.approve_status);
     if (parameter.approve_status != "On_Sale" && parameter.approve_status != "Un_Sale" && parameter.approve_status != "In_Stock")
     {
         result = OpenApiErrorMessage.ShowErrorMsg((Enum)(object)OpenApiErrorCode.Product_Status_is_Invalid, "approve_status");
         return(false);
     }
     return(true);
 }