import request from '@/utils/request'

export function getTree(data) {
  return request({
      url: 'pipe/controlpoint/getTree',
      method: 'post',
      data
  })
}

export function getEntityFromCache(id) {
  return request({
      url: 'pipe/controlpoint/getEntityFromCache',
      method: 'post',
      data: id
  })
}

export function add(data) {
  return request({
    url: 'pipe/controlpoint/insert',
    method: 'post',
    data
  })
}

export function edit(data) {
    return request({
      url: 'pipe/controlpoint/update',
      method: 'post',
      data
    })
  }

export function del(ids) {
  return request({
    url: 'pipe/controlpoint/delete',
    method: 'post',
    data: ids
  })
}

export default { add, edit, del, getEntityFromCache }