From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java index de118b4..1a861c7 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java @@ -1,6 +1,7 @@ package com.yeshi.fanli.controller.client.v1; import java.io.PrintWriter; +import java.util.Date; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -10,6 +11,7 @@ import com.yeshi.fanli.entity.SystemPIDInfo; import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; import com.yeshi.fanli.lijin.manager.UserLijinMnager; +import com.yeshi.fanli.service.inter.user.UserFunctionsLimitService; import com.yeshi.fanli.service.manger.PIDManager; import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; import com.yeshi.fanli.util.SystemInfoUtil; @@ -102,7 +104,10 @@ @Resource private UserLijinMnager userLijinMnager; - private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) { + @Resource + private UserFunctionsLimitService userFunctionsLimitService; + + private void doTaoLiJinBuy(AcceptData acceptData, Long uid, String auctionId, PrintWriter out) { JSONObject data = new JSONObject(); TaoBaoLink taoBaoLink = null; try { @@ -140,7 +145,7 @@ } - private void getTaoBaoLinkWithoutFanLi(AcceptData acceptData, Long auctionId, String from, String source, + private void getTaoBaoLinkWithoutFanLi(AcceptData acceptData, String auctionId, String from, String source, HttpServletRequest request, PrintWriter out) { try { @@ -170,15 +175,21 @@ * @param out */ @RequestMapping(value = "gettaobaolink") - public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, String from, String source, + public void getTaoBaoLink(AcceptData acceptData, Long uid, String auctionId, String from, String source, HttpServletRequest request, PrintWriter out) { - if (auctionId == null || auctionId <= 0) { + if (StringUtil.isNullOrEmpty(auctionId)) { out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧ID涓嶈兘涓虹┖")); return; } if (!SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.fanli)) { + getTaoBaoLinkWithoutFanLi(acceptData, auctionId, from, source, request, out); + return; + } + + //棰嗗埜 + if (uid == null) { getTaoBaoLinkWithoutFanLi(acceptData, auctionId, from, source, request, out); return; } @@ -194,6 +205,10 @@ out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); return; } + if (userFunctionsLimitService.isLimit(uid, SystemFunction.fanli, new Date())) { + out.print(JsonUtil.loadFalseResult(1, "璇ュ姛鑳介檺鍒朵娇鐢�")); + return; + } try { // 鏃ュ織璁板綍 @@ -206,7 +221,7 @@ TaoBaoGoodsBrief goods = null; try { - goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId); + goods = TaoKeApiUtil.getSimpleGoodsInfoForOwnBuy(auctionId); } catch (TaobaoGoodsDownException e) { out.print(JsonUtil.loadFalseResult(3, "鍟嗗搧宸蹭笅鏋�")); return; @@ -436,7 +451,7 @@ if ("TB".equalsIgnoreCase(goodsType)) { TaoBaoGoodsBrief goods = null; try { - goods = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(goodsId)); + goods = TaoKeApiUtil.getSimpleGoodsInfo(goodsId); } catch (NumberFormatException e) { e.printStackTrace(); } catch (TaobaoGoodsDownException e) { @@ -468,7 +483,7 @@ * @param out */ @RequestMapping(value = "deleteRecommendGoods") - public void deleteRecommendGoods(AcceptData acceptData, Long goodsId, Integer source, Long uid, String reason, + public void deleteRecommendGoods(AcceptData acceptData, String goodsId, Integer source, Long uid, String reason, PrintWriter out) { if (goodsId == null) { out.print(JsonUtil.loadFalseResult(1, "璇蜂笂浼犲晢鍝�")); -- Gitblit v1.8.0