Esempio n. 1
0
        /// <summary>
        /// taobao.item.sku.update 更新SKU信息
        /// </summary>
        /// <returns></returns>
        public Sku UpdateSku(ItemSkuUpdateRequest req)
        {
            _log.LogInfo(Resource.Log_UpdateSkuing.StringFormat(req.NumIid, req.Properties, req.OuterId));

            req.ThrowIfNull(Resource.ExceptionTemplate_MethedParameterIsNullorEmpty.StringFormat(new StackTrace()));

            var tContext = InstanceLocator.Current.GetInstance <AuthorizedContext>();

            var response = _client.Execute(req, tContext.SessionKey);

            if (response.IsError)
            {
                var ex = new TopResponseException(response.ErrCode, response.ErrMsg, response.SubErrCode,
                                                  response.SubErrMsg, response.TopForbiddenFields);
                _log.LogError(Resource.Log_UpdateSkuFailure.StringFormat(req.NumIid, req.Properties, req.OuterId), ex);
            }

            _log.LogInfo(Resource.Log_UpdateSkuSuccess.StringFormat(req.NumIid, req.Properties, req.OuterId));

            return(response.Sku);
        }
Esempio n. 2
0
        /// <summary>
        /// taobao.item.sku.update 更新SKU信息
        /// </summary>
        /// <returns></returns>
        public Sku UpdateSku(ItemSkuUpdateRequest req)
        {
            _log.LogInfo(Resource.Log_UpdateSkuing.StringFormat(req.NumIid, req.Properties, req.OuterId));

            req.ThrowIfNull(Resource.ExceptionTemplate_MethedParameterIsNullorEmpty.StringFormat(new StackTrace()));

            var tContext = InstanceLocator.Current.GetInstance<AuthorizedContext>();

            var response = _client.Execute(req, tContext.SessionKey);

            if (response.IsError)
            {
                var ex = new TopResponseException(response.ErrCode, response.ErrMsg, response.SubErrCode,
                                               response.SubErrMsg, response.TopForbiddenFields);
                _log.LogError(Resource.Log_UpdateSkuFailure.StringFormat(req.NumIid, req.Properties, req.OuterId), ex);

            }

            _log.LogInfo(Resource.Log_UpdateSkuSuccess.StringFormat(req.NumIid, req.Properties, req.OuterId));

            return response.Sku;
        }