From 81da61b828e29b7745e1382dfbbaeb685dc083ef Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 23 一月 2024 17:17:55 +0800
Subject: [PATCH] 抖音转链修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java
index debe461..ebc4123 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/PinDuoDuoControllerV2.java
@@ -6,7 +6,9 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.SystemPIDInfo;
 import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
+import com.yeshi.fanli.service.manger.PIDManager;
 import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
 import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
 import com.yeshi.fanli.vo.common.WXXCXJumpInfoVO;
@@ -57,6 +59,9 @@
 
     @Resource
     private PDDAuthService pddAuthService;
+
+    @Resource
+    private PIDManager pidManager;
 
 
     /**
@@ -127,9 +132,9 @@
         String pid = null;
         //鑷喘
         if (type == 1) {
-            pid = PinDuoDuoApiUtil.PID_FANLI;
+            pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.fanli);
         } else {//鍒嗕韩
-            pid = PinDuoDuoApiUtil.PID_SHARE;
+            pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.share);
         }
 
         PDDConvertLinkResultVO authLink = PinDuoDuoApiUtil.getAuthLink(pid, pddAuthService.getFanliCustomParams(uid));
@@ -151,4 +156,28 @@
         out.print(JsonUtil.loadTrueResult(data));
     }
 
+
+    @RequestMapping(value = "isAuth")
+    public void isAuth(AcceptData acceptData, Long uid, int type, PrintWriter out) {
+        if (uid == null || uid == 0L) {
+            out.print(JsonUtil.loadFalseResult("璇峰厛鐧诲綍"));
+            return;
+        }
+        String pid = null;
+        //鑷喘
+        if (type == 1) {
+            pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.fanli);
+        } else {//鍒嗕韩
+            pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.share);
+        }
+
+        String customParams = pddAuthService.getFanliCustomParams(uid);
+        boolean auth = PinDuoDuoApiUtil.isAuth(pid, customParams);
+        if (auth) {
+            out.print(JsonUtil.loadTrueResult(""));
+        } else {
+            out.print(JsonUtil.loadFalseResult("灏氭湭鎺堟潈"));
+        }
+    }
+
 }

--
Gitblit v1.8.0