import request from '../utils/request'

const api = {
  Task: '/QK/Task',
  TaskDetail: '/QK/Task/Detail',
  AdminClientList: '/Admin/QK/Client/List',
  AdminClientDelete: '/Admin/QK/Client/Delete',
  AdminClientEnable: '/Admin/QK/Client/Enable',
  AdminTaskList: '/Admin/QK/Task/List',
  AdminTaskDetail: '/Admin/QK/Task/Detail',
  AdminTaskUpdate: '/Admin/QK/Task/Update',
  AdminTaskCancel: '/Admin/QK/Task/Cancel',
  AdminTaskRetry: '/Admin/QK/Task/Retry',
  AdminTaskStart: '/Admin/QK/Task/Start',
  AdminTaskPause: '/Admin/QK/Task/Pause',
  AdminReportList: '/Admin/QK/Report/List',
  TaskStart: '/QK/Task/Start',
  TaskPause: '/QK/Task/Pause',
  Batch: '/QK/Batch',
  AdminBatchList: '/Admin/QK/Batch/List',
  AdminBatchSave: '/Admin/QK/Batch/Save',
  AdminJwAccount: '/Admin/JW/Account'
}

export function getQkTask(parameter) {
  return request({
    url: api.Task,
    method: 'get',
    params: parameter
  })
}

export function getQkTaskDetail(parameter) {
  return request({
    url: api.TaskDetail,
    method: 'get',
    params: parameter
  })
}

export function saveQkTask(parameter) {
  return request({
    url: api.Task,
    method: 'post',
    data: parameter
  })
}

export function deleteQkTask(parameter) {
  return request({
    url: api.Task,
    method: 'delete',
    data: parameter
  })
}

export function startQkTask(parameter) {
  return request({
    url: api.TaskStart,
    method: 'post',
    data: parameter
  })
}

export function pauseQkTask(parameter) {
  return request({
    url: api.TaskPause,
    method: 'post',
    data: parameter
  })
}

export function getQkBatchList(parameter) {
  return request({
    url: api.Batch,
    method: 'get',
    params: parameter
  })
}

export function adminQkBatchList(parameter) {
  return request({
    url: api.AdminBatchList,
    method: 'get',
    params: parameter
  })
}

export function adminQkBatchSave(parameter) {
  return request({
    url: api.AdminBatchSave,
    method: 'post',
    data: parameter
  })
}

export function adminQkClientList(parameter) {
  return request({
    url: api.AdminClientList,
    method: 'get',
    params: parameter
  })
}

export function adminQkClientDelete(parameter) {
  return request({
    url: api.AdminClientDelete,
    method: 'delete',
    data: parameter
  })
}

export function adminQkClientEnable(parameter) {
  return request({
    url: api.AdminClientEnable,
    method: 'post',
    data: parameter
  })
}

export function adminQkTaskList(parameter) {
  return request({
    url: api.AdminTaskList,
    method: 'get',
    params: parameter
  })
}

export function adminQkTaskDetail(parameter) {
  return request({
    url: api.AdminTaskDetail,
    method: 'get',
    params: parameter
  })
}

export function adminQkTaskUpdate(parameter) {
  return request({
    url: api.AdminTaskUpdate,
    method: 'post',
    data: parameter
  })
}

export function adminQkTaskCancel(parameter) {
  return request({
    url: api.AdminTaskCancel,
    method: 'delete',
    data: parameter
  })
}

export function adminQkTaskRetry(parameter) {
  return request({
    url: api.AdminTaskRetry,
    method: 'post',
    data: parameter
  })
}

export function adminQkTaskStart(parameter) {
  return request({
    url: api.AdminTaskStart,
    method: 'post',
    data: parameter
  })
}

export function adminQkTaskPause(parameter) {
  return request({
    url: api.AdminTaskPause,
    method: 'post',
    data: parameter
  })
}

export function adminQkReportList(parameter) {
  return request({
    url: api.AdminReportList,
    method: 'get',
    params: parameter
  })
}

export function adminGetJwAccount(parameter) {
  return request({
    url: api.AdminJwAccount,
    method: 'get',
    params: parameter
  })
}
