|
@@ -2,15 +2,12 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
-import cn.com.ctop.common.module.utils.Check;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAdvertiserBaseInfo;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.ISyncPullMaterialService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.List;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
@@ -26,8 +23,7 @@ public class SyncPullMaterialServiceImpl implements ISyncPullMaterialService {
|
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
|
@Autowired
|
|
|
private IKuaishouInterfaceService iKuaishouInterfaceService;
|
|
|
- static ExecutorService videoExecutorService = Executors.newFixedThreadPool(10);
|
|
|
- static ExecutorService suZhaoExecutorService = Executors.newFixedThreadPool(10);
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -39,23 +35,8 @@ public class SyncPullMaterialServiceImpl implements ISyncPullMaterialService {
|
|
|
*/
|
|
|
@Override
|
|
|
public void getSyncVideoList(Long accountId, String startDate, String endDate) {
|
|
|
- KuaiShouAdvertiserBaseInfo baseInfo = KuaiShouAdvertiserBaseInfoService.getBaseInfo(accountId);
|
|
|
- if (!Check.isNull(baseInfo)) {
|
|
|
- List<KuaiShouAdvertiserBaseInfo> baseInfoList = KuaiShouAdvertiserBaseInfoService.getAccountIdList(baseInfo.getUserId());
|
|
|
- if (!Check.isNull(baseInfoList)) {
|
|
|
- for (KuaiShouAdvertiserBaseInfo advertiserBaseInfo : baseInfoList) {
|
|
|
- CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserBaseInfo.getAccountId());
|
|
|
- if (!Check.isNull(token)) {
|
|
|
- videoExecutorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- iKuaishouInterfaceService.getVideoList(token, startDate, endDate);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
+ iKuaishouInterfaceService.getVideoList(token, startDate, endDate);
|
|
|
}
|
|
|
|
|
|
|