| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.goods.douyin.CSJCPSApiUtil; |
| | | import com.yeshi.fanli.util.goods.douyin.DYUtil; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoodsDetail; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil; |
| | | import org.jsoup.Jsoup; |
| | |
| | | //新版口令 |
| | | String goodsId = null; |
| | | if (text.contains("https://m.tb.cn/")) { |
| | | try { |
| | | TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(text); |
| | | if (result != null) { |
| | | goodsId = result.getNum_iid(); |
| | | } |
| | | } catch (TaoBaoTokenParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (goodsId == null) { |
| | | String auctionId = DaTaoKeApiUtil.parseTaoBaoToken(text); |
| | | if (auctionId != null) { |
| | | typeSet.add(ClipboardContentType.taoBaoToken); |
| | | goodsId = auctionId; |
| | | String tempGoodsId = DaTaoKeApiUtil.parseGoodsIdFromToken(text); |
| | | if (tempGoodsId != null) { |
| | | goodsId = tempGoodsId; |
| | | typeSet.add(ClipboardContentType.taoBaoToken); |
| | | } else { |
| | | try { |
| | | TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(text); |
| | | if (result != null) { |
| | | goodsId = result.getNum_iid(); |
| | | typeSet.add(ClipboardContentType.taoBaoToken); |
| | | } |
| | | } catch (TaoBaoTokenParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (goods != null) { |
| | | commonGoods = CommonGoodsFactory.create(goods); |
| | | } |
| | | }else if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_DY) { |
| | | DYGoodsDetail goods = CSJCPSApiUtil.goodsDetail(Long.parseLong( simpleGoods.getGoodsId())); |
| | | if (goods != null) { |
| | | commonGoods = CommonGoodsFactory.create(goods); |
| | | } |
| | | } |
| | | |
| | | return commonGoods; |
| | |
| | | if (!StringUtil.isNullOrEmpty(vipId)) { |
| | | return new SimpleCommonGoods(vipId, Constant.SOURCE_TYPE_VIP); |
| | | } |
| | | String dyProductId= DYUtil.parseProdectIdFromLink(link); |
| | | if (!StringUtil.isNullOrEmpty(dyProductId)) { |
| | | return new SimpleCommonGoods(dyProductId, Constant.SOURCE_TYPE_DY); |
| | | } |
| | | |
| | | // 解析淘宝 |
| | | String auctionId = parseTBAuctionIdFromLink(link); |