panchengyong
2024-11-14 5342eabf93cf9c72df456ccfb8dcffb339a9f402
新增scrapy spider同步大V账号信息job调用
4 files modified
46 ■■■■■ changed files
src/main/java/com/jw/ai/controller/TaskController.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/jw/ai/entity/CookiePool.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/jw/ai/service/ITaskService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/jw/ai/service/impl/TaskServiceImpl.java 22 ●●●● patch | view | raw | blame | history
src/main/java/com/jw/ai/controller/TaskController.java
@@ -39,6 +39,11 @@
        return ServerResponseEntity.success(taskService.taskList(param));
    }
    /**
     * 启动任务
     * @param id
     * @return
     */
    @GetMapping("updateStatus/{id}")
    public ServerResponseEntity<?> updateStatus(@PathVariable("id") Long id) {
        log.info("updateStatus id : {}", id);
@@ -46,6 +51,18 @@
        return ServerResponseEntity.success();
    }
    /**
     * 大V账号信息同步
     * @return
     */
    @GetMapping("vUserProfileAsync")
    public ServerResponseEntity<?> vUserProfileAsync() {
        log.info("vUserProfileAsync:");
        taskService.execVUserProfileAsyncPyJob();
        return ServerResponseEntity.success();
    }
    @GetMapping("getHitDetail")
    public ServerResponseEntity<HitDetailVO> getHitDetail(HitDetailDTO param) {
        log.info("getHitDetail param : {}", JSONUtil.toJsonStr(param));
src/main/java/com/jw/ai/entity/CookiePool.java
@@ -76,6 +76,6 @@
    /**
     * 租户Id
     */
    private Integer tenantId;
    private Long tenantId;
}
src/main/java/com/jw/ai/service/ITaskService.java
@@ -37,6 +37,11 @@
    void updateStatusById(Long id);
    /**
     * 执行抖音大V账号信息同步run spider
     * @return
     */
    String execVUserProfileAsyncPyJob();
    /**
     * 任务关键词命中详情
     * @param id
     * @return
src/main/java/com/jw/ai/service/impl/TaskServiceImpl.java
@@ -27,6 +27,7 @@
import com.jw.ai.entity.*;
import com.jw.ai.enums.DemandStatusEnum;
import com.jw.ai.enums.JobStatusEnum;
import com.jw.ai.enums.PublishTypeEnum;
import com.jw.ai.exception.JwAiException;
import com.jw.ai.mapper.FansCommentsGotMapper;
import com.jw.ai.mapper.JobExecLogMapper;
@@ -224,9 +225,6 @@
        }
        return null;
    }
    @Override
@@ -574,6 +572,23 @@
        }
    }
    /**
     * 执行抖音大V账号信息同步run spider
     * @return
     */
    @Override
    public String execVUserProfileAsyncPyJob() {
        HashMap<String, Object> body = new HashMap<>();
        body.put("project", "aijuke_spider");
        body.put("spider", "douyin_v_user_profile_spider");
        body.put("jobid", DateFormatUtil.getDateTime());
        log.info("execVUserProfileAsyncPyJob ==> request url {}", body);
        String s = HttpUtil.post(pythonScriptConfig.getScheduleJob(), body);
        return s;
    }
    /**
     * 更新PY任务状态
     * AI分析中的不更新状态
@@ -751,6 +766,7 @@
        return s;
    }
    /**
     * 获取任务执行策略
     * @param obj