| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "gettaobaolink")
|
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId,String from, HttpServletRequest request,
|
| | | public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, String from, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
|
| | |
| | | if (acceptData.getPlatform().equalsIgnoreCase("ios"))
|
| | | pidType = PidUser.TYPE_FANLI_IOS;
|
| | | try {
|
| | |
|
| | | TaoBaoLink taoBaoLink = null;
|
| | | // 是返利商品库的商品
|
| | | if (specialConvert) {
|
| | |
| | | else
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
|
| | | tbPidService.getIOSDefault().getPid());
|
| | | |
| | |
|
| | | } else
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
|
| | | LogHelper.test("购买转链:默认PID转链-"+uid+":"+auctionId);
|
| | | LogHelper.test("购买转链:默认PID转链-" + uid + ":" + auctionId);
|
| | | }
|
| | | } else {// 不是返利库的商品,用特殊PID替代
|
| | | try {
|
| | |
| | | else
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
|
| | | tbPidService.getIOSDefault().getPid());
|
| | | |
| | | LogHelper.test("购买转链:默认PID转链-非返利库商品-"+uid+":"+auctionId);
|
| | |
|
| | | LogHelper.test("购买转链:默认PID转链-非返利库商品-" + uid + ":" + auctionId);
|
| | | }
|
| | | }
|
| | | JSONObject link = new JSONObject();
|
| | |
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_IOS);
|
| | | }
|
| | | |
| | | LogHelper.test("购买转链:默认PID转链-异常商品-"+uid+":"+auctionId);
|
| | |
|
| | | LogHelper.test("购买转链:默认PID转链-异常商品-" + uid + ":" + auctionId);
|
| | |
|
| | | data.put("native", isNative);
|
| | |
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | ClientTBPid clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | data.put("type", 2);
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | |
|
| | | try {
|
| | | TaoBaoLink taoBaoLink = null;
|
| | | if (pidType == PidUser.TYPE_FANLI_ANDROID)
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
|
| | | tbPidService.getAndroidDefault().getPid());
|
| | | else
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLink(uid, auctionId,
|
| | | tbPidService.getIOSDefault().getPid());
|
| | |
|
| | | JSONObject link = new JSONObject();
|
| | | link.put("clickUrl", taoBaoLink.getClickUrl());
|
| | | link.put("couponUrl", taoBaoLink.getCouponLink());
|
| | | data.put("type", 1);
|
| | | data.put("link", link);
|
| | | data.put("native", true);
|
| | |
|
| | | } catch (Exception e1) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | ClientTBPid clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | data.put("type", 2);
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | | data.put("native", true);
|
| | | }
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请求失败"));
|