|
@@ -8,6 +8,7 @@ import cn.com.ctop.job.bytedance.utils.FeishuRobotUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
import io.netty.util.internal.StringUtil;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,6 +20,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
+@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
public class BytedancePromoteRefreshServiceImpl implements IBytedancePromoteRefreshService {
|
|
public class BytedancePromoteRefreshServiceImpl implements IBytedancePromoteRefreshService {
|
|
|
@Resource
|
|
@Resource
|
|
@@ -134,6 +136,20 @@ public class BytedancePromoteRefreshServiceImpl implements IBytedancePromoteRefr
|
|
|
}
|
|
}
|
|
|
String token = String.valueOf(tokenobj);
|
|
String token = String.valueOf(tokenobj);
|
|
|
|
|
|
|
|
|
|
+ String serialNo = linkInfo.getString("sort");
|
|
|
|
|
+ String albumId = linkInfo.getString("album_id");
|
|
|
|
|
+ String episodeId = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ String platform_config = linkInfo.getString("platform_config");
|
|
|
|
|
+ if (!Check.isNull(platform_config)){
|
|
|
|
|
+ JSONObject platformConfigJson = JSON.parseObject(platform_config);
|
|
|
|
|
+ if (!platformConfigJson.containsKey("douyinyun")){
|
|
|
|
|
+ }
|
|
|
|
|
+ episodeId = platformConfigJson.getJSONObject("douyinyun").getString("episode_id");
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("解析平台配置失败: " + e.getMessage(), e);
|
|
|
|
|
+ }
|
|
|
//douyin
|
|
//douyin
|
|
|
String path = promoterUri.split("\\?")[0];
|
|
String path = promoterUri.split("\\?")[0];
|
|
|
String url = "https://open.douyin.com/api/apps/v1/url_link/generate/";
|
|
String url = "https://open.douyin.com/api/apps/v1/url_link/generate/";
|
|
@@ -141,8 +157,12 @@ public class BytedancePromoteRefreshServiceImpl implements IBytedancePromoteRefr
|
|
|
query.put("link_id", String.valueOf(linkId));
|
|
query.put("link_id", String.valueOf(linkId));
|
|
|
query.put("video_id", String.valueOf(videoId));
|
|
query.put("video_id", String.valueOf(videoId));
|
|
|
query.put("video_detail_id", String.valueOf(videoDetailId));
|
|
query.put("video_detail_id", String.valueOf(videoDetailId));
|
|
|
- query.put("type", String.valueOf(mediaType));
|
|
|
|
|
|
|
+ query.put("type", "1");
|
|
|
query.put("source", "link");
|
|
query.put("source", "link");
|
|
|
|
|
+ query.put("serialNo", serialNo);
|
|
|
|
|
+ query.put("app_id", appId);
|
|
|
|
|
+ query.put("tt_album_id", albumId);
|
|
|
|
|
+ query.put("tt_episode_id", episodeId);
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("app_id", appId);
|
|
params.put("app_id", appId);
|
|
|
params.put("app_name", "douyin");
|
|
params.put("app_name", "douyin");
|