schedueManager.ts
2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { defHttp } from '/@/utils/http/axios';
import { ReportModel, ReportQueryParam } from './model/schedueModel';
enum ReportManagerApi {
GET_REPORT_API = '/monitor/job/page',
POST_REPORT_API = '/monitor/job/add',
DELETE_REPORT_API = '/monitor/job',
PUT_REPORT_API = '/monitor/job/update',
PUTID_REPORT_API = '/monitor/job',
RUN_REPORT_API = '/monitor/job/run',
JOB_LOG_DETAIL_API = '/monitor/job_log/get/',
JOB_LOG_PAGE_API = '/monitor/job_log/page',
DELETE_LOG_API = '/monitor/job_log',
POST_LOG_CLEAN_API = '/monitor/job_log/clean',
QUERY_CORN_API = '/monitor/job/query_cron_expression/',
CHECK_CORN_API = '/monitor/job/check_cron/',
}
//分页
export const scheduePage = (params: ReportQueryParam) => {
return defHttp.get<ReportQueryParam>({
url: ReportManagerApi.GET_REPORT_API,
params,
});
};
//删除
export const deleteSchedueManage = (ids: string[]) => {
return defHttp.delete({
url: ReportManagerApi.DELETE_REPORT_API,
data: {
ids: ids,
},
});
};
// 创建
export const createOrEditSchedueManage = (data) => {
return defHttp.post<ReportModel>({
url: ReportManagerApi.POST_REPORT_API,
data,
});
};
// 编辑
export const putSchedueConfigManage = (data) => {
return defHttp.post<ReportModel>({
url: ReportManagerApi.PUT_REPORT_API,
data,
});
};
// 修改状态 id status
export const putSchedueByidAndStatusManage = (id, status) => {
return defHttp.put<ReportModel>({
url: ReportManagerApi.PUTID_REPORT_API + '/change_status/' + id + '/' + status,
});
};
//执行一次
export const postRunSchedueConfigManage = (id) => {
return defHttp.post<ReportModel>({
url: ReportManagerApi.RUN_REPORT_API + '/' + id,
});
};
// 查询cron表达式近5次的执行时间
export const schedueQueryCornTimeApi = (data) => {
return defHttp.post({
url: ReportManagerApi.QUERY_CORN_API,
data,
});
};
// 检查cron表达式是否有效
export const schedueCheckCornApi = (data) => {
return defHttp.post({
url: ReportManagerApi.CHECK_CORN_API,
data,
});
};
/**
* 调度日志
*/
//分页
export const schedueLogPage = (params: ReportQueryParam) => {
return defHttp.get<ReportQueryParam>({
url: ReportManagerApi.JOB_LOG_PAGE_API,
params,
});
};
//删除
export const deleteSchedueLogManage = (ids: string[]) => {
return defHttp.delete({
url: ReportManagerApi.DELETE_LOG_API,
data: {
ids: ids,
},
});
};
// 清空
export const schedueLogCleanPage = () => {
return defHttp.post<ReportModel>({
url: ReportManagerApi.POST_LOG_CLEAN_API,
});
};
//详情
export const schedueLogDetailPage = (jobId, id) => {
return defHttp.get<ReportQueryParam>({
url: ReportManagerApi.JOB_LOG_DETAIL_API + jobId + '/' + id,
});
};