Beispiel #1
0
 public void OfferNewTest()
 {
     var model = new OfferNew();
     model.amountOnSale = 100;
     model.bizType = 1;
     model.categoryID = 1048305;
     model.freightTemplateId = 61;
     model.freightType = "F";
     model.mixWholeSale = true;
     model.supportOnlineTrade = true;
     model.subject = "测试产品,勿买";
     model.priceRanges = "1000:20`2000:19";
     model.sendGoodsAddressId = 7655580;
     model.priceAuthOffer = false;
     model.pictureAuthOffer = false;
     model.offerWeight = 0.5;
     var result = AliContext.Static.Product.OfferNew(model);
 }
Beispiel #2
0
 /// <summary>
 /// 本接口通过数据接口的形式,实现阿里巴巴中文站登录会员发布offer的功能。每个客户每天最多新发布1000个产品。
 /// </summary>
 public long? OfferNew(OfferNew model)
 {
     string url = "http://gw.open.1688.com:80/openapi/param2/1/cn.alibaba.open/offer.new/{0}".FormatStr(_context.Config.AppKey);
     var otherParas = _context.GetParas();
     if (model != null)
     {
         string offerStr = JsonConvert.SerializeObject(model);
         otherParas.Add("offer", offerStr);
     }
     _context.Util.AddAliApiUrlSignPara(url, otherParas);
     var results = _context.Util.Send<AliResult<AliResultList<long?>>>(url, otherParas);
     if (results.Message != null && results.Message.Length > 0)
     {
         throw new AliResultException(string.Join(",", results.Message));
     }
     if (results.Result == null || !results.Result.Success)
         return null;
     return results.Result.ToReturn.First();
 }