This is an automated email from the ASF dual-hosted git repository.

fanjia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/seatunnel-web.git


The following commit(s) were added to refs/heads/main by this push:
     new d6f774da [Improvement][Seatunnel-web] Execute job REST API should be 
of type POST, not GET (#183)
d6f774da is described below

commit d6f774dae0a575181b228c680cfc9b0b57b90c7f
Author: Mohammad Arshad <[email protected]>
AuthorDate: Thu Aug 15 07:38:04 2024 +0530

    [Improvement][Seatunnel-web] Execute job REST API should be of type POST, 
not GET (#183)
---
 .../org/apache/seatunnel/app/controller/JobExecutorController.java   | 5 +++--
 seatunnel-ui/src/service/sync-task-definition/index.ts               | 2 +-
 .../seatunnel/app/controller/JobExecutorControllerWrapper.java       | 5 ++++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/JobExecutorController.java
 
b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/JobExecutorController.java
index 1a41e15b..ee7773d1 100644
--- 
a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/JobExecutorController.java
+++ 
b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/JobExecutorController.java
@@ -25,6 +25,7 @@ import org.apache.seatunnel.server.common.SeatunnelErrorEnum;
 import org.apache.seatunnel.server.common.SeatunnelException;
 
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -46,8 +47,8 @@ public class JobExecutorController {
     @Resource IJobExecutorService jobExecutorService;
     @Resource private IJobInstanceService jobInstanceService;
 
-    @GetMapping("/execute")
-    @ApiOperation(value = "Execute synchronization tasks", httpMethod = "GET")
+    @PostMapping("/execute")
+    @ApiOperation(value = "Execute synchronization tasks", httpMethod = "POST")
     public Result<Long> jobExecutor(
             @ApiParam(value = "userId", required = true) 
@RequestAttribute("userId") Integer userId,
             @ApiParam(value = "jobDefineId", required = true) 
@RequestParam("jobDefineId")
diff --git a/seatunnel-ui/src/service/sync-task-definition/index.ts 
b/seatunnel-ui/src/service/sync-task-definition/index.ts
index 3abcc37a..74bfc8e3 100644
--- a/seatunnel-ui/src/service/sync-task-definition/index.ts
+++ b/seatunnel-ui/src/service/sync-task-definition/index.ts
@@ -317,7 +317,7 @@ export function sqlModelInfo(taskId: string, pluginId: 
string, data: any): any {
 export function executeJob(jobDefineId: number): any {
   return axios({
     url: `/job/executor/execute?jobDefineId=${jobDefineId}`,
-    method: 'get',
+    method: 'post',
     headers: {
       'Content-Type': 'application/json;charset=UTF-8'
     },
diff --git 
a/seatunnel-web-it/src/test/java/org/apache/seatunnel/app/controller/JobExecutorControllerWrapper.java
 
b/seatunnel-web-it/src/test/java/org/apache/seatunnel/app/controller/JobExecutorControllerWrapper.java
index 760d0831..af23fce5 100644
--- 
a/seatunnel-web-it/src/test/java/org/apache/seatunnel/app/controller/JobExecutorControllerWrapper.java
+++ 
b/seatunnel-web-it/src/test/java/org/apache/seatunnel/app/controller/JobExecutorControllerWrapper.java
@@ -26,7 +26,10 @@ public class JobExecutorControllerWrapper extends 
SeatunnelWebTestingBase {
 
     public Result<Long> jobExecutor(Long jobDefineId) {
         String response =
-                sendRequest(urlWithParam("job/executor/execute?jobDefineId=" + 
jobDefineId));
+                sendRequest(
+                        urlWithParam("job/executor/execute?jobDefineId=" + 
jobDefineId),
+                        "{}",
+                        "POST");
         return JSONTestUtils.parseObject(response, new 
TypeReference<Result<Long>>() {});
     }
 

Reply via email to