package com.inspect.job.task;

import com.alibaba.fastjson.JSONObject;
import com.inspect.job.client.TaskExecClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("patrolTaskExecBody")
public class PatrolTaskExecBody {
    final
    TaskExecClient taskExecClient;

    public PatrolTaskExecBody(TaskExecClient taskExecClient) {
        this.taskExecClient = taskExecClient;
    }

    public void patrolTaskExec(Long taskId) {
        JSONObject patrolTask = new JSONObject();
        patrolTask.put("taskId", taskId);
        this.taskExecClient.immediatelyExecTask(patrolTask);
    }
}
