Prechádzať zdrojové kódy

添加爆款视频数据清洗定时任务

syh 4 rokov pred
rodič
commit
c322a6c262

+ 27 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceEtlVideoJob.java

@@ -0,0 +1,27 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoEtlInfoService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class BytedanceEtlVideoJob {
+
+    @Autowired
+    private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
+    @XxlJob("bytedanceEtlVideoJob")
+    public void execute() throws Exception {
+        Date startDate = DateUtils.addDay(new Date(),-2);
+        for(int i=0;i<=2;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
+        }
+    }
+}

+ 24 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouEtlVideoJob.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoEtlInfoService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class KuaishouEtlVideoJob {
+    @Autowired
+    private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
+    @XxlJob("kuaishouEtlVideoJob")
+    public void execute() throws Exception {
+        Date startDate = DateUtils.addDay(new Date(),-2);
+        for(int i=0;i<=2;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
+        }
+    }
+}