|
@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.utils.*;
|
|
|
import cn.com.ctop.toutiao.modules.material.entity.*;
|
|
|
import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceCreativeMapper;
|
|
|
+import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceVideoInfoMapper;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.*;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author 宋英豪
|
|
@@ -44,6 +46,9 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
|
@Autowired
|
|
|
private IByteDanceVideoInfoService videoInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ByteDanceVideoInfoMapper byteDanceVideoInfoMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public JSONObject getAdvertiserList(String token, Long accountId) {
|
|
|
JSONObject returnJson = new JSONObject();
|
|
@@ -637,6 +642,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
|
|
|
|
@Override
|
|
|
public void getMaterialList(CtopOauthToken token) {
|
|
|
+ updaBytedanceVideoByAccountId(token);
|
|
|
getVideoByPage(token, "", 1);
|
|
|
getImageByPage(token, "", 1);
|
|
|
}
|
|
@@ -723,12 +729,14 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
|
log.info("获取视频素材完成==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
|
|
|
return;
|
|
|
}
|
|
|
+ log.info("数据数量======》》》{}",data.size());
|
|
|
List<ByteDanceVideoInfo> videoInfoList = new ArrayList<>();
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
ByteDanceVideoInfo videoInfo = new ByteDanceVideoInfo(dataObject, token);
|
|
|
videoInfoList.add(videoInfo);
|
|
|
}
|
|
|
+ log.info("数据======》》》{}",videoInfoList);
|
|
|
videoInfoService.replaceBatch(videoInfoList);
|
|
|
getVideoByPage(token, videoIds, page + 1);
|
|
|
}
|
|
@@ -787,4 +795,20 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 头条上传视频素材信息 根据账户id 修改状态
|
|
|
+ * @param token
|
|
|
+ */
|
|
|
+ public void updaBytedanceVideoByAccountId(CtopOauthToken token){
|
|
|
+ byteDanceVideoInfoMapper.updaBytedanceVideoByAccountId(token.getAccountId(),0);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|