import request from '@/utils/request'

export function getTestRuleAll() {
  return request({
    url: '/examtest/testrule/',
    method: 'get',
  })
}

export function getTestRuleDetail(id){
  return request({
    url: `/examtest/testrule/${id}/`,
    method: 'get',
  })
}

export function createTestRule(data) {
  return request({
    url: '/examtest/testrule/',
    method: 'post',
    data
  })
}
export function updateTestRule(id, data) {
  return request({
    url: `/examtest/testrule/${id}/`,
    method: 'put',
    data
  })
}
export function deleteTestRule(id) {
  return request({
    url: `/examtest/testrule/${id}/`,
    method: 'delete',
  })
}

export function getWorkScopeAll(query) {
  return request({
    url: '/examtest/workscope/',
    method: 'get',
    params: query
  })
}

export function getWorkScopDetail(id){
  return request({
    url: `/examtest/workscope/${id}/`,
    method: 'get',
  })
}

export function createWorkScope(data) {
  return request({
    url: '/examtest/workscope/',
    method: 'post',
    data
  })
}
export function updateWorkScope(id, data) {
  return request({
    url: `/examtest/workscope/${id}/`,
    method: 'put',
    data
  })
}
export function deleteWorkScope(id) {
  return request({
    url: `/examtest/workscope/${id}/`,
    method: 'delete',
  })
}

export function getExamTestlist(query) {
  return request({
    url: '/examtest/examtest/',
    method: 'get',
    params: query
  })
}

export function getExamTestDetail(id){
  return request({
    url: `/examtest/examtest/${id}/`,
    method: 'get',
  })
}
export function getPaperList(query) {
  return request({
    url: '/examtest/paper/',
    method: 'get',
    params: query
  })
}

export function getPaperDetail(id){
  return request({
    url: `/examtest/paper/${id}/`,
    method: 'get',
  })
}
export function createPaper(data) {
  return request({
    url: '/examtest/paper/',
    method: 'post',
    data
  })
}
export function updatePaper(id, data) {
  return request({
    url: `/examtest/paper/${id}/`,
    method: 'put',
    data
  })
}
export function clonePaper(id) {
  return request({
    url: `/examtest/paper/${id}/clone/`,
    method: 'put',
  })
}

export function deletePaper(id) {
  return request({
    url: `/examtest/paper/${id}/`,
    method: 'delete',
  })
}
export function exportTest(query) {
  return request({
    url: '/examtest/examtest/export',
    method: 'get',
    params: query
  })
}

export function exportwTest(id,data) {
  return request({
    url: `/examtest/examtest/${id}/exportw/`,
    method: 'post',
    data: data
  })
}

export function issue(id) {
  return request({
    url: `/examtest/examtest/${id}/issue/`,
    method: 'post',
  })
}

export function deleteExamtest(id) {
  return request({
    url: `/examtest/examtest/${id}/`,
    method: 'delete',
  })
}