admin
2019-03-13 69bee82b81626b82b7f39f0e459e4f56b1699b51
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -461,6 +461,7 @@
      return getTaoBaoLink(uid, auctionId, tbPid.getPid());
   }
   @Override
   public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException {
      if (uid == null || uid <= 0) {
@@ -490,6 +491,7 @@
      } catch (TaobaoGoodsDownException e) {
         throw new ShareGoodsException(4, "商品已下架");
      } finally {
      }
      if (goods == null) {
         throw new ShareGoodsException(5, "获取商品详情失败");
@@ -523,7 +525,22 @@
         throw new ShareGoodsException(2, "商品ID不能为空");
      }
      return getTaoBaoLink(uid, auctionId, Constant.TAOBAO_SPECIAL_PID_DEFAULT);
      TaoKeAppInfo app = new TaoKeAppInfo();
      app.setAppKey(Constant.TAOBAO_AUTH_APPKEY);
      app.setAppSecret(Constant.TAOBAO_AUTH_APPSECRET);
      app.setPid(Constant.TAOBAO_SPECIAL_PID_DEFAULT);
      TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app);
      if (goods == null) {
         throw new ShareGoodsException(1, "");
      }
      TaoBaoLink taoBaoLink = new TaoBaoLink();
      taoBaoLink.setAuctionId(auctionId);
      taoBaoLink.setClickUrl(goods.getAuctionUrl());
      taoBaoLink.setCouponLink(goods.getCouponLink());
      taoBaoLink.setGoods(goods);
      return taoBaoLink;
   }
}