import request from '@/utils/request'

// 查询定时任务调度列表
export function listJob(query) {
  return request({
    url: '/tool/job/list',
    method: 'get',
    params: query
  })
}

// 查询定时任务调度详细
export function getJob(jobName) {
  return request({
    url: '/tool/job/' + jobName,
    method: 'get'
  })
}

// 删除定时任务调度
export function delJob(jobNames) {
  return request({
    url: '/tool/job/' + jobNames,
    method: 'delete'
  })
}

// 任务状态修改
export function changeJobStatus(jobName, status) {
  const data = {
    jobName,
    status
  }
  return request({
    url: '/tool/job/changeStatus',
    method: 'put',
    data: data
  })
}
