/// <summary>
        /// 批量获取产品属性
        /// </summary>
        /// <returns></returns>
        public ItemsListGetResponse TaobaoAttrGet(string numIids)
        {
            var req = new ItemsListGetRequest {
                Fields = "num_iid,nick,title,price,cid,item_img,props_name,pic_url", NumIids = numIids
            };
            var response = _client.Execute(req, "");

            return(response);
        }
Example #2
0
        /// <summary>
        /// 批量获取商品信息
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        internal IList <Item> GetListItems(string sessionKey, string ListNumIids)
        {
            ITopClient          client = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json");
            ItemsListGetRequest req    = new ItemsListGetRequest();

            req.Fields  = "approve_status,num_iid,title,nick,type,desc,skus,cid,pic_url,num,props,valid_thru, list_time,price,has_discount,has_invoice,has_warranty,has_showcase, modified,delist_time,postage_id,seller_cids,outer_id";
            req.NumIids = ListNumIids;
            ItemsListGetResponse response = client.Execute(req, sessionKey);

            return(ChangeTypeForItem(response.Body));
        }
Example #3
0
        /// <summary>
        ///     得到产品列表
        /// </summary>
        /// <param name="numIds">各ID以","号分割</param>
        /// <returns></returns>
        public List <Item> GetGoodsList(string numIds)
        {
            var tContext = InstanceLocator.Current.GetInstance <AuthorizedContext>();

            var req = new ItemsListGetRequest {
                Fields = "num_iid,cid,num,sku,title,price,outer_id", NumIids = numIds
            };

            ItemsListGetResponse 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_GetGoodsListFailure, ex);
                throw ex;
            }

            return(response.Items);
        }
Example #4
0
        /// <summary>
        ///     得到产品列表
        /// </summary>
        /// <param name="numIds">各ID以","号分割</param>
        /// <returns></returns>
        public List<Item> GetGoodsList(string numIds)
        {
            var tContext = InstanceLocator.Current.GetInstance<AuthorizedContext>();

            var req = new ItemsListGetRequest { Fields = "num_iid,cid,num,sku,title,price,outer_id", NumIids = numIds };

            ItemsListGetResponse 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_GetGoodsListFailure, ex);
                throw ex;
            }

            return response.Items;
        }