wfansh 5 months ago
parent
commit
c508b1679c

+ 45 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/xxl/DataForSEOJob.java

@@ -0,0 +1,45 @@
+package org.jeecg.modules.xxl;
+
+import com.xxl.job.core.handler.annotation.XxlJob;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.adweb.common.constant.AdwebConstant;
+import org.jeecg.modules.adweb.seo.service.dataforseo.DataForSEOService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * DataForSEO Serp查询及同步任务,{@link DataForSEOService}
+ *
+ * @author wfansh
+ */
+@Slf4j
+@Component
+public class DataForSEOJob {
+
+    @Autowired private DataForSEOService dataForSEOService;
+
+    @XxlJob("runLongTailKeywordsSerpTasksHandler")
+    public void runLongTailKeywordsSerpTasksHandler() {
+        log.info("执行长尾词Serp查询...");
+        dataForSEOService.runKeywordsSerpTasks(
+                AdwebConstant.KEYWORD_TYPE_LONG_TAIL, Integer.MAX_VALUE);
+        log.info("执行长尾词Serp查询结束");
+    }
+
+    @XxlJob("runAppointKeywordsSerpTasksHandler")
+    public void runAppointKeywordsSerpTasksHandler() {
+        log.info("执行指定词Serp查询...");
+        dataForSEOService.runKeywordsSerpTasks(
+                AdwebConstant.KEYWORD_TYPE_APPOINT, Integer.MAX_VALUE);
+        log.info("执行指定词Serp查询结束");
+    }
+
+    @XxlJob("syncKeywordsSerpResultsHandler")
+    public void syncKeywordsSerpResultsHandler() {
+        log.info("同步关键词Serp查询结果...");
+        dataForSEOService.syncKeywordsSerpResults();
+        log.info("同步关键词Serp查询结果结束");
+    }
+}