Unverified Commit 7246b1f5 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Feature-635][admin] Add job instance info api

[Feature-635][admin] Add job instance info api
parents 67900115 63d8bcaf
package com.dlink.controller; package com.dlink.controller;
import com.dlink.assertion.Asserts;
import com.dlink.model.JobInstance;
import com.dlink.model.Task;
import com.dlink.service.JobInstanceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -38,6 +42,8 @@ public class APIController { ...@@ -38,6 +42,8 @@ public class APIController {
private StudioService studioService; private StudioService studioService;
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired
private JobInstanceService jobInstanceService;
@GetMapping("/submitTask") @GetMapping("/submitTask")
public Result submitTask(@RequestParam Integer id) { public Result submitTask(@RequestParam Integer id) {
...@@ -120,4 +126,20 @@ public class APIController { ...@@ -120,4 +126,20 @@ public class APIController {
public Result reOnLineTask(@RequestParam Integer id) { public Result reOnLineTask(@RequestParam Integer id) {
return taskService.reOnLineTask(id); return taskService.reOnLineTask(id);
} }
/**
* 获取Job实例的所有信息
*/
@GetMapping("/getJobInfoDetail")
public Result getJobInfoDetail(@RequestParam Integer id) {
return Result.succeed(jobInstanceService.getJobInfoDetail(id), "获取成功");
}
/**
* 通过 taskId 获取 Task 对应的 Job 实例的所有信息
*/
@GetMapping("/getJobInfoDetailByTaskId")
public Result getJobInfoDetailByTaskId(@RequestParam Integer id) {
return Result.succeed(jobInstanceService.getJobInstanceByTaskId(id), "获取成功");
}
} }
...@@ -64,6 +64,17 @@ const TaskAPI = (props: any) => { ...@@ -64,6 +64,17 @@ const TaskAPI = (props: any) => {
<CodeShow code={`curl http://${address}/openapi/restartTask?id=${(task ? task.id : '1')}`} language='shell' <CodeShow code={`curl http://${address}/openapi/restartTask?id=${(task ? task.id : '1')}`} language='shell'
height='500px' theme="vs-dark"/> height='500px' theme="vs-dark"/>
</TabPane> </TabPane>
<TabPane
tab={
<span>
作业实例
</span>
}
key="taskInstance"
>
<CodeShow code={`curl http://${address}/openapi/getJobInfoDetailByTaskId?id=${(task ? task.id : '1')}`} language='shell'
height='500px' theme="vs-dark"/>
</TabPane>
<TabPane <TabPane
tab={ tab={
<span> <span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment