using System; using System.Collections.Generic; using Top.Api.Util; namespace Top.Api.Request { /// /// TOP API: taobao.product.get /// public class ProductGetRequest : BaseTopRequest { /// /// 商品类目id.调用taobao.itemcats.get获取;必须是叶子类目id,如果没有传product_id,那么cid和props必须要传. /// public Nullable Cid { get; set; } /// /// 需返回的字段列表.可选值:Product数据结构中的所有字段;多个字段之间用","分隔. /// public string Fields { get; set; } /// /// Product的id.两种方式来查看一个产品:1.传入product_id来查询 2.传入cid和props来查询 /// public Nullable ProductId { get; set; } /// /// 比如:诺基亚N73这个产品的关键属性列表就是:品牌:诺基亚;型号:N73,对应的PV值就是10005:10027;10006:29729. /// public string Props { get; set; } #region ITopRequest Members public override string GetApiName() { return "taobao.product.get"; } public override IDictionary GetParameters() { TopDictionary parameters = new TopDictionary(); parameters.Add("cid", this.Cid); parameters.Add("fields", this.Fields); parameters.Add("product_id", this.ProductId); parameters.Add("props", this.Props); if (this.otherParams != null) { parameters.AddAll(this.otherParams); } return parameters; } public override void Validate() { RequestValidator.ValidateRequired("fields", this.Fields); } #endregion } }