import request from '@/utils/request'

const urlPrefix = '/api/water/pipe'

export function listPipeInfo(query) {
  return request({
    url: urlPrefix + '/page',
    method: 'get',
    params: query
  })
}

export function getPipeInfo(id) {
  return request({
    url: urlPrefix + '/' + id,
    method: 'get'
  })
}

export function addPipeInfo(data) {
  return request({
    url: urlPrefix,
    method: 'post',
    data: data
  })
}

export function updatePipeInfo(data) {
  return request({
    url: urlPrefix,
    method: 'put',
    data: data
  })
}

export function delPipeInfo(ids) {
  return request({
    url: urlPrefix + '/' + ids,
    method: 'delete'
  })
}

export function listRecyclePipeInfo(query) {
  return request({
    url: urlPrefix + '/recycle/list',
    method: 'get',
    params: query
  })
}

export function restorePipeInfo(ids) {
  return request({
    url: urlPrefix + '/recycle/restore/' + ids,
    method: 'post'
  })
}

export function deletePhysicallyPipeInfo(ids) {
  return request({
    url: urlPrefix + '/recycle/delete/' + ids,
    method: 'delete'
  })
}
