feat(executor): 完成任务提交执行的验证
This commit is contained in:
@@ -7,6 +7,10 @@ package com.lanyuanxiaoyao.service.executor.core;
|
||||
* @date 2023-12-04
|
||||
*/
|
||||
public interface TaskConstants {
|
||||
String TASK_ID = "task-id";
|
||||
String TASK_ID_OPTION = "-" + TASK_ID;
|
||||
String TASK_RESULT_PATH = "task-result-path";
|
||||
String TASK_RESULT_PATH_OPTION = "-" + TASK_RESULT_PATH;
|
||||
String TASK_CONTEXT = "task-context";
|
||||
String TASK_CONTEXT_OPTION = "-" + TASK_CONTEXT;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.lanyuanxiaoyao.service.executor.core;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -10,15 +11,31 @@ import java.util.Map;
|
||||
* @date 2023-12-04
|
||||
*/
|
||||
public class TaskContext implements Serializable {
|
||||
private String taskId;
|
||||
private String resultPath;
|
||||
private Map<String, Object> metadata;
|
||||
|
||||
public TaskContext() {
|
||||
}
|
||||
|
||||
public TaskContext(Map<String, Object> metadata) {
|
||||
public TaskContext(String taskId, String resultPath) {
|
||||
this(taskId, resultPath, new HashMap<>());
|
||||
}
|
||||
|
||||
public TaskContext(String taskId, String resultPath, Map<String, Object> metadata) {
|
||||
this.taskId = taskId;
|
||||
this.resultPath = resultPath;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public String getResultPath() {
|
||||
return resultPath;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
@@ -26,7 +43,9 @@ public class TaskContext implements Serializable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TaskContext{" +
|
||||
"metadata=" + metadata +
|
||||
'}';
|
||||
"taskId='" + taskId + '\'' +
|
||||
", resultPath='" + resultPath + '\'' +
|
||||
", metadata=" + metadata +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user