|
@@ -10,7 +10,6 @@ import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
import org.quartz.JobExecutionException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -29,10 +28,9 @@ public class KuaishouMaterialsLoadJob implements Job {
|
|
Thread thread = new Thread() {
|
|
Thread thread = new Thread() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
-
|
|
|
|
List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
String endDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
String endDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
- String startDate = DateUtils.getAnotherDay("yyyy-mm-dd", endDate, -1);
|
|
|
|
|
|
+ String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
|
|
executorService = Executors.newFixedThreadPool(8);
|
|
executorService = Executors.newFixedThreadPool(8);
|
|
tokens.forEach(token -> {
|
|
tokens.forEach(token -> {
|
|
executorService.submit(new Runnable() {
|
|
executorService.submit(new Runnable() {
|
|
@@ -55,29 +53,5 @@ public class KuaishouMaterialsLoadJob implements Job {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
thread.start();
|
|
thread.start();
|
|
-
|
|
|
|
- //增加接口的开始和结束日期
|
|
|
|
- Date startDate = DateUtils.addDay(new Date(), -1);
|
|
|
|
- Date endDate = new Date();
|
|
|
|
- //1:查询当日数据
|
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
|
- executorService = Executors.newFixedThreadPool(8);
|
|
|
|
- tokens.forEach(token -> {
|
|
|
|
- executorService.submit(new Runnable() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- try {
|
|
|
|
- //获取全量视频素材数据
|
|
|
|
- kuaishouInterfaceService.getVideoList(token, DateUtils.getNowDate("yyyy-MM-dd"));
|
|
|
|
- // 获取图片信息数据
|
|
|
|
- kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- } finally {
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- log.info("快手物料数据同步完成");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|