예제 #1
0
        /// <summary>
        /// taobao.tbk.shop.get( 淘宝客店铺查询 )
        /// doc:https://open.taobao.com/api.htm?docId=24521&docType=2
        /// </summary>
        public static void QueryShop()
        {
            var client = GetClient();

            TbkShopGetRequest req = new TbkShopGetRequest();

            req.Fields = "user_id,shop_title,shop_type,seller_nick,pict_url,shop_url";
            req.Q      = "女装";//查询词,必须
            req.Sort   = "commission_rate_des";
            //req.IsTmall = false;
            //req.StartCredit = 1L;
            //req.EndCredit = 20L;
            //req.StartCommissionRate = 2000L;
            //req.EndCommissionRate = 123L;
            //req.StartTotalAction = 1L;
            //req.EndTotalAction = 100L;
            //req.StartAuctionCount = 123L;
            //req.EndAuctionCount = 200L;
            //req.Platform = 1L;
            //req.PageNo = 1L;
            //req.PageSize = 20L;
            TbkShopGetResponse rsp = client.Execute(req);

            Console.WriteLine(rsp.Body);
        }
예제 #2
0
 /// <summary>
 /// 获取商铺信息
 /// </summary>
 /// <param name="req"></param>
 /// <returns></returns>
 public TbkShopGetResponse GetShopInfo(TbkShopGetRequest req)
 {
     if (req == null)
     {
         return(null);
     }
     return(Client.Execute(req));
 }
예제 #3
0
        /// <summary>
        /// 获取商铺信息
        /// </summary>
        /// <param name="shopTitle"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public NTbkShop GetShopInfo(string shopTitle, long userId)
        {
            var taoBaoClient = new TaoBaoClient();
            var result       = new NTbkShop();

            try
            {
                var req = new TbkShopGetRequest
                {
                    Fields = "user_id,shop_title,shop_type,seller_nick,pict_url,shop_url",
                    Q      = shopTitle
                };

                var responseresult = taoBaoClient.GetShopInfo(req);

                result = responseresult.Results.FirstOrDefault(x => x.UserId == userId);
            }
            catch (Exception ex)
            {
                LogHelper.Exception(ex);
            }
            return(result);
        }