import request from '@/utils/request'

const api = {
  testPlanList: 'test/testPlan/testPlanList',
  addTestPlan: 'test/testPlan/addPlan',
  delTestPlan: 'test/testPlan/deletePlan',
  updateTestPlan: 'test/testPlan/updatePlan',
  testPlanDetail: 'test/testPlan/planDetail',
  testPlanProjectList: '/test/testPlanProject/list',
  addTestReport:  'test/testReport/addTestReport',
  getTestReportList: 'test/testReport/reportList'
}

export function getTestPlanList(data) {
  return request({
    url: api.testPlanList,
    method: 'get',
    params: data
  })
}

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

export function delTestPlan(id) {
  return request({
    url: api.delTestPlan,
    method: 'post',
    data: {id}
  })
}

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

export function getTestPlanDetail(id) {
  return request({
    url: api.testPlanDetail,
    method: 'post',
    data: {id}
  })
}

export function getTestPlanProjectList(id) {
  return request({
    url: api.testPlanProjectList,
    method: 'post',
    data: {id}
  })
}

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

export function getTestReportList(id) {
  return request({
    url: api.getTestReportList,
    method: 'post',
    data: {id}
  })
}
