import request from '@/utils/request'
// 目录
export function getClassTreeApi() {
  return request({
    url: '/system/QualityTaskCatalog/tree',
    method: 'get'
  })
}
// 树节点新增
export function getTreeAdd(data) {
  return request({
    url: '/system/QualityTaskCatalog/add',
    method: 'post',
    data
  })
}

// 树节点删除
export function getTreeRemove(params) {
  return request({
    url: '/system/QualityTaskCatalog/remove',
    method: 'get',
    params
  })
}
// 树节点编辑
export function getTreeUpdate(data) {
  return request({
    url: '/system/QualityTaskCatalog/update',
    method: 'post',
    data
  })
}
// 树节点详情
export function getTreeDetail(id) {
  return request({
    url: '/system/QualityTaskCatalog/' + id,
    method: 'get'
  })
}

// 获取列表
export function getList(data) {
  return request({
    url: '/system/QualityTaskBasic/list',
    method: 'post',
    data
  })
}

// 修改详细信息
export function getUpdate(data) {
  return request({
    url: '/system/QualityTaskBasic/update',
    method: 'post',
    data
  })
}
export function getDetail(id) {
  return request({
    url: '/system/QualityTaskBasic/' + id,
    method: 'get'
  })
}
// 添加
export function getAdd(data) {
  return request({
    url: '/system/QualityTaskBasic/add',
    method: 'post',
    data
  })
}
// 删除
export function getRemove(params) {
  return request({
    url: '/system/QualityTaskBasic/remove',
    method: 'get',
    params
  })
}

// 定时任务立即执行一次
export function runTask(id) {
  const data = {
    id
  }
  return request({
    url: '/system/taskInstance/runTask',
    method: 'post',
    data: data
  })
}

// 定时任务-启动
export function startTask(id) {
  const data = {
    id
  }
  return request({
    url: '/system/taskInstance/startTask',
    method: 'post',
    data: data
  })
}

// 定时任务-暂停
export function pauseTask(id) {
  const data = {
    id
  }
  return request({
    url: '/system/taskInstance/pauseTask',
    method: 'post',
    data: data
  })
}
