提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface JobVO { |
|
4 |
id: number |
|
5 |
name: string |
|
6 |
status: number |
|
7 |
handlerName: string |
|
8 |
handlerParam: string |
|
9 |
cronExpression: string |
|
10 |
retryCount: number |
|
11 |
retryInterval: number |
|
12 |
monitorTimeout: number |
|
13 |
createTime: Date |
|
14 |
} |
|
15 |
|
|
16 |
// 任务列表 |
|
17 |
export const getJobPage = (params: PageParam) => { |
|
18 |
return request.get({ url: '/infra/job/page', params }) |
|
19 |
} |
|
20 |
|
|
21 |
// 任务详情 |
|
22 |
export const getJob = (id: number) => { |
|
23 |
return request.get({ url: '/infra/job/get?id=' + id }) |
|
24 |
} |
|
25 |
|
|
26 |
// 新增任务 |
|
27 |
export const createJob = (data: JobVO) => { |
|
28 |
return request.post({ url: '/infra/job/create', data }) |
|
29 |
} |
|
30 |
|
|
31 |
// 修改定时任务调度 |
|
32 |
export const updateJob = (data: JobVO) => { |
|
33 |
return request.put({ url: '/infra/job/update', data }) |
|
34 |
} |
|
35 |
|
|
36 |
// 删除定时任务调度 |
|
37 |
export const deleteJob = (id: number) => { |
|
38 |
return request.delete({ url: '/infra/job/delete?id=' + id }) |
|
39 |
} |
|
40 |
|
|
41 |
// 导出定时任务调度 |
|
42 |
export const exportJob = (params) => { |
|
43 |
return request.download({ url: '/infra/job/export-excel', params }) |
|
44 |
} |
|
45 |
|
|
46 |
// 任务状态修改 |
|
47 |
export const updateJobStatus = (id: number, status: number) => { |
|
48 |
const params = { |
|
49 |
id, |
|
50 |
status |
|
51 |
} |
|
52 |
return request.put({ url: '/infra/job/update-status', params }) |
|
53 |
} |
|
54 |
|
|
55 |
// 定时任务立即执行一次 |
|
56 |
export const runJob = (id: number) => { |
|
57 |
return request.put({ url: '/infra/job/trigger?id=' + id }) |
|
58 |
} |
|
59 |
|
|
60 |
// 获得定时任务的下 n 次执行时间 |
|
61 |
export const getJobNextTimes = (id: number) => { |
|
62 |
return request.get({ url: '/infra/job/get_next_times?id=' + id }) |
|
63 |
} |