admin
2020-06-08 457f4881a89c03984c7b46ed10e8919d3294976c
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -855,11 +855,11 @@
      // 商品链接
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePathJD(), "", id + "");
//      try {
//         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//      } catch (Exception e) {
         extraVO.setH5Url(h5Url);
//      }
      // try {
      // extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      // } catch (Exception e) {
      extraVO.setH5Url(h5Url);
      // }
      String helpLink = null;
      extraVO.setFanliValid(true);
@@ -1034,11 +1034,11 @@
      // 分享路径
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
//      try {
//         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//      } catch (Exception e) {
         extraVO.setH5Url(h5Url);
//      }
      // try {
      // extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      // } catch (Exception e) {
      extraVO.setH5Url(h5Url);
      // }
      String helpLink = null;
      extraVO.setFanliValid(true);
@@ -1174,11 +1174,11 @@
      // 分享路径
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
//      try {
//         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//      } catch (Exception e) {
         extraVO.setH5Url(h5Url);
//      }
      // try {
      // extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      // } catch (Exception e) {
      extraVO.setH5Url(h5Url);
      // }
      String helpLink = null;
      extraVO.setFanliValid(true);
@@ -1564,6 +1564,9 @@
      } else {
         jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "",
               uid + "");
         if (StringUtil.isNullOrEmpty(jumpLink)) {
            jumpLink = couponUrl;
         }
      }
      JSONObject data = new JSONObject();
@@ -1590,6 +1593,9 @@
      String materialId = "https://item.jd.com/" + id + ".html";
      jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", null);
      if (StringUtil.isNullOrEmpty(jumpLink)) {
         jumpLink = couponUrl;
      }
      JSONObject data = new JSONObject();
      data.put("native", true);
@@ -1783,6 +1789,22 @@
         } else {
            data.put("extend", true);
         }
      } else if (goodsType == Constant.SOURCE_TYPE_VIP) {
         VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId);
         if (goods == null) {
            data.put("extend", false);
            data.put("url","");
         } else {
            data.put("extend", true);
         }
      } else if (goodsType == Constant.SOURCE_TYPE_SUNING) {
         SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(goodsId.split("-")[1], goodsId.split("-")[0]);
         if (goods == null) {
            data.put("extend", false);
            data.put("url", String.format("https://m.suning.com/product/%s/%s.html", goodsId.split("-")[0],goodsId.split("-")[1]));
         } else {
            data.put("extend", true);
         }
      }
      out.print(JsonUtil.loadTrueResult(data));
   }