WangHan
2024-09-12 d5855a4926926698b740bc6c7ba489de47adb68b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package tech.powerjob.client;
 
import tech.powerjob.common.request.http.SaveJobInfoRequest;
import tech.powerjob.common.request.http.SaveWorkflowNodeRequest;
import tech.powerjob.common.request.http.SaveWorkflowRequest;
import tech.powerjob.common.request.query.JobInfoQuery;
import tech.powerjob.common.response.*;
 
import java.util.List;
 
/**
 * PowerJobClient, the client for OpenAPI.
 *
 * @author tjq
 * @since 2023/3/5
 */
public interface IPowerJobClient {
 
    /* ************* Job 区 ************* */
 
    ResultDTO<SaveJobInfoRequest> exportJob(Long jobId);
 
    ResultDTO<Long> saveJob(SaveJobInfoRequest request);
 
    ResultDTO<Long> copyJob(Long jobId);
 
    ResultDTO<JobInfoDTO> fetchJob(Long jobId);
 
    ResultDTO<List<JobInfoDTO>> fetchAllJob();
 
    ResultDTO<List<JobInfoDTO>> queryJob(JobInfoQuery powerQuery);
 
    ResultDTO<Void> disableJob(Long jobId);
 
    ResultDTO<Void> enableJob(Long jobId);
 
    ResultDTO<Void> deleteJob(Long jobId);
 
    ResultDTO<Long> runJob(Long jobId, String instanceParams, long delayMS);
 
    /* ************* Instance API list ************* */
 
    ResultDTO<Void> stopInstance(Long instanceId);
 
    ResultDTO<Void> cancelInstance(Long instanceId);
 
    ResultDTO<Void> retryInstance(Long instanceId);
 
    ResultDTO<Integer> fetchInstanceStatus(Long instanceId);
 
    ResultDTO<InstanceInfoDTO> fetchInstanceInfo(Long instanceId);
 
    /* ************* Workflow API list ************* */
    ResultDTO<Long> saveWorkflow(SaveWorkflowRequest request);
 
    ResultDTO<Long> copyWorkflow(Long workflowId);
 
    ResultDTO<List<WorkflowNodeInfoDTO>> saveWorkflowNode(List<SaveWorkflowNodeRequest> requestList);
 
    ResultDTO<WorkflowInfoDTO> fetchWorkflow(Long workflowId);
 
    ResultDTO<Void> disableWorkflow(Long workflowId);
 
    ResultDTO<Void> enableWorkflow(Long workflowId);
 
    ResultDTO<Void> deleteWorkflow(Long workflowId);
 
    ResultDTO<Long> runWorkflow(Long workflowId, String initParams, long delayMS);
 
    /* ************* Workflow Instance API list ************* */
 
    ResultDTO<Void> stopWorkflowInstance(Long wfInstanceId);
 
    ResultDTO<Void> retryWorkflowInstance(Long wfInstanceId);
 
    ResultDTO<Void> markWorkflowNodeAsSuccess(Long wfInstanceId, Long nodeId);
 
    ResultDTO<WorkflowInstanceInfoDTO> fetchWorkflowInstanceInfo(Long wfInstanceId);
}