| | |
| | | return getTaoBaoLink(uid, auctionId, tbPid.getPid());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException {
|
| | |
|
| | | if (uid == null || uid <= 0) {
|
| | |
| | | } catch (TaobaoGoodsDownException e) {
|
| | | throw new ShareGoodsException(4, "商品已下架");
|
| | | } finally {
|
| | |
|
| | | }
|
| | | if (goods == null) {
|
| | | throw new ShareGoodsException(5, "获取商品详情失败");
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | }
|