import request from '@/utils/request'

const api = {
  planCaseList: 'test/planCase/list',
  relateCaseList: '/test/case/planRelateList',
  saveRelate: 'test/planCase/saveRelate',
  delRelate: 'test/planCase/delRelate/',
}

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

// 查询可关联的用例列表
export function getRelateCaseList(data) {
  return request({
    url: api.relateCaseList,
    method: 'get',
    params: data
  })
}

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

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

// 执行用例
export function runTestPlanCase(data) {
  return request({
    url: '/test/case/runTestPlanCase',
    method: 'post',
    data
  })
}

