Skip to content

Commit

Permalink
[Improvement][Seatunnel-web] Execute job REST API should be of type P…
Browse files Browse the repository at this point in the history
…OST, not GET (#183)
  • Loading branch information
arshadmohammad authored Aug 15, 2024
1 parent 7205efe commit d6f774d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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;
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion seatunnel-ui/src/service/sync-task-definition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>>() {});
}

Expand Down

0 comments on commit d6f774d

Please sign in to comment.