import request from "@/utils/request";

// 添加服务申请
export function saveServiceInfo(data) {
  return request.post("/pt/service/save", data);
}

// 添加服务申请
export function deleteService(data) {
  return request.get('/pt/service/delete', data);
}

// 添加服务申请
export function getServiceAllParam(id) {
  return request.get(`/pt/service/param/list/${id}`);
}

// 添加服务参数
export function addServiceParam(data) {
  return request.post("/pt/service/param/addList", data);
}

// 删除服务参数
export function delServiceParam(query) {
  return request({
    url: "/pt/service/param/delete",
    method: "get",
    params: query,
  });
}
export function getServiceInfo(query) {
  return request({
    url: "/pt/service/modelService",
    method: "get",
    params: query,
  });
}
// export function getServiceInfo(id) {
//   return request.get(`/pt/service/modelService/${id}`);
// }

export function getPtServiceList(query) {
  return request({
    url: "/pt/service/listBySuccess",
    method: "get",
    params: query,
  });
}
export function modelTreeSelect(query) {
  return request({
    url: "/interfaces/cate/modelTreeSelect",
    method: "get",
    params: query,
  });
}
export function getSerDe(id) {
  return request.get(`/pt/service/get/${id}`);
}
export function addService(data) {
  return request.post("/pt/service/save", data);
}
export function addParam(data) {
  return request.post("/pt/service/param/addList", data);
}
export function editService(data) {
  return request({
    url: '/pt/service',
    method: 'put',
    data: data
  })
}
export function editParam(data) {
  return request({
    url: '/pt/service/param/update',
    method: 'post',
    data: data
  })
}
export function delService(id) {
  return request({
    url: '/pt/service/' + id,
    method: 'delete'
  })
}
export function getTreeDe(id) {
  return request.get(`/interfaces/cate/${id}`);
}
export function addTree(data) {
  return request({
    url: '/interfaces/cate',
    method: 'post',
    data: data
  })
}
export function deTree(id) {
  return request({
    url: '/interfaces/cate/' + id,
    method: 'delete'
  })
}
export function getServiceReturn(query) {
  return request({
    url: "/service/return/list",
    method: "get",
    params: query,
  });
}
export function postReturnlist(data) {
  return request({
    url: "/service/return/addList",
    method: 'post',
    data:data
  });
}
export function testService(data) {
  return request({
    url: "/pt/service/testRun",
    method: 'post',
    data:data
  });
}