/// <summary> /// 获取前台展示的店铺内卖家自定义商品类目 /// </summary> /// <param name="sessionKey"></param> /// <param name="sellerNick"></param> /// <returns></returns> public static List <ShopCat> GetCatsList(string sessionKey, string sellerNick) { try { ITopClient client = TBManager.GetClient(); ShopcatsListGetRequest req = new ShopcatsListGetRequest(); //req.Nick = sellerNick; req.Fields = "cid,name"; ShopcatsListGetResponse response = client.Execute(req, sessionKey); return(response.ShopCats); } catch (Exception ex) { //ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi); return(null); } }
/// <summary> /// 获取前台展示的店铺类目 /// </summary> internal List <ShopCat> GetDPLM() { ITopClient client = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json"); ShopcatsListGetRequest req = new ShopcatsListGetRequest(); req.Fields = "cid,parent_cid,name,is_parent"; ShopcatsListGetResponse response = client.Execute(req); List <Top.Api.Domain.ShopCat> listshopcat = response.ShopCats; List <ShopCat> Listshopcate = new List <ShopCat>(); foreach (Top.Api.Domain.ShopCat item in listshopcat) { ShopCat shopcat = new ShopCat(); shopcat.Cid = item.Cid; shopcat.IsParent = item.IsParent; shopcat.Name = item.Name; shopcat.ParentCid = item.ParentCid; Listshopcate.Add(shopcat); } return(Listshopcate); }