import request from '@/utils/request'

// 单元下拉
export function getUnitList(buildingId) {
  return request({
    url: '/gas/unit/getUnit',
    method: 'get',
    params: {buildingId: buildingId}
  })
}

// 查询单元列表
export function listUnit(query) {
  return request({
    url: '/gas/unit/list',
    method: 'get',
    params: query
  })
}

// 查询单元详细
export function getUnit(id) {
  return request({
    url: '/gas/unit/' + id,
    method: 'get'
  })
}

// 新增单元
export function addUnit(data) {
  return request({
    url: '/gas/unit',
    method: 'post',
    data: data
  })
}

// 修改单元
export function updateUnit(data) {
  return request({
    url: '/gas/unit',
    method: 'put',
    data: data
  })
}

// 删除单元
export function delUnit(id) {
  return request({
    url: '/gas/unit/' + id,
    method: 'delete'
  })
}
