import service from '@/utils/request'

export const queryAllTunnels = () => {
  return service({
    url: '/tunnel/queryAllTunnels',
    method: 'get'
  })
}

export const queryTunnelList = (data) => {
  return service({
    url: '/tunnel/queryTunnelList',
    method: 'post',
    data
  })
}

export const queryNoRegionTunnels = () => {
  return service({
    url: '/tunnel/queryNoRegionTunnels',
    method: 'get'
  })
}

export const createTunnel = (data) => {
  return service({
    url: '/tunnel/createTunnel',
    method: 'post',
    data
  })
}

export const updateTunnel = (data) => {
  return service({
    url: '/tunnel/updateTunnel',
    method: 'put',
    data
  })
}

export const updateTunnelLamp = (data) => {
  return service({
    url: '/tunnel/updateTunnelLamp',
    method: 'put',
    data
  })
}

export const updateTactics = (data) => {
  return service({
    url: '/tunnel/updateTactics',
    method: 'put',
    data
  })
}

export const updateTunnelsRegion = (data) => {
  return service({
    url: '/tunnel/updateTunnelsRegion',
    method: 'put',
    data
  })
}

export const updateTunnelTime = (data) => {
  return service({
    url: '/tunnel/updateTunnelTime',
    method: 'put',
    data
  })
}

export const deleteTunnel = (id) => {
  return service({
    url: `/tunnel/deleteTunnel?id=${id}`,
    method: 'delete'
  })
}
