Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement][Seatunnel-web] Execute job REST API should be of type POST, not GET #183

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading