|
@@ -254,6 +254,50 @@ public class TestController {
|
|
return "Success";
|
|
return "Success";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/getVideoByAccountId")
|
|
|
|
+ public String getVideoByAccountId(Long accountId) throws IOException {
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ Thread thread = new Thread() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tokenQueryWrapper.eq("media_id", 2);
|
|
|
|
+ tokenQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ CtopOauthToken one = tokenService.getOne(tokenQueryWrapper);
|
|
|
|
+ try {
|
|
|
|
+ kuaishouInterfaceService.getSuZaoList(one.getAccessToken(), one.getAccountId(), 1);
|
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
|
+ String videoEndDate = DateUtils.addDay(nowDate, -180);
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ Date end = simpleDateFormat.parse(nowDate);
|
|
|
|
+ Date start = simpleDateFormat.parse(videoEndDate);
|
|
|
|
+ List<Date> dates = DateUtils.findDates(start, end);
|
|
|
|
+ for (int i = 0; i < dates.size(); i++) {
|
|
|
|
+ String formatDate = simpleDateFormat.format(dates.get(i));
|
|
|
|
+ kuaishouInterfaceService.getVideoList(one, formatDate);
|
|
|
|
+ kuaishouInterfaceService.getImageList(one, formatDate);
|
|
|
|
+ Thread.sleep(100);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } finally {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ log.info("快手物料数据同步完成");
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ thread.start();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return "Success";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@GetMapping(value = "/createCutTask")
|
|
@GetMapping(value = "/createCutTask")
|
|
public String createCutTask(String startDate, String endDate) throws IOException {
|
|
public String createCutTask(String startDate, String endDate) throws IOException {
|
|
|
|
|
|
@@ -477,8 +521,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/gerCreative")
|
|
@GetMapping(value = "/gerCreative")
|
|
public void gerCreative() {
|
|
public void gerCreative() {
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|