import request from '@/utils/request'

export function pageCheckJob(data) {
  return request({
    url: '/data/quality/scheduleJobs/page',
    method: 'get',
    params: data
  })
}

export function saveCheckJob(data) {
  return request({
    url: '/data/quality/scheduleJobs',
    method: 'post',
    data: data
  })
}

export function updateCheckJob(data) {
  return request({
    url: '/data/quality/scheduleJobs/' + data.id,
    method: 'put',
    data: data
  })
}

export function delCheckJob(id) {
  return request({
    url: '/data/quality/scheduleJobs/' + id,
    method: 'delete'
  })
}

export function delCheckJobs(ids) {
  return request({
    url: '/data/quality/scheduleJobs/batch/' + ids,
    method: 'delete'
  })
}

export function pauseCheckJob(id) {
  return request({
    url: '/data/quality/scheduleJobs/pause/' + id,
    method: 'post'
  })
}

export function resumeCheckJob(id) {
  return request({
    url: '/data/quality/scheduleJobs/resume/' + id,
    method: 'post'
  })
}

/* zrx add */
export function runCheckJob(id) {
  return request({
    url: '/data/quality/scheduleJobs/run/' + id,
    method: 'post'
  })
}

export function getScheduleJobById(id) {
  return request({
    url: '/data/quality/scheduleJobs/' + id,
    method: 'get'
  })
}
