import request from '@/utils/request'

// 查询一级分类列表
export function listParentDeviceCategory() {
  return request({
    url: '/business/deviceCategory/parentList',
    method: 'get'
  })
}
// 查询设备分类列表
export function listDeviceCategory(query) {
  return request({
    url: '/business/deviceCategory/list',
    method: 'get',
    params: query
  })
}

// 查询设备分类详细
export function getDeviceCategory(categoryId) {
  return request({
    url: '/business/deviceCategory/' + categoryId,
    method: 'get'
  })
}

// 新增设备分类
export function addDeviceCategory(data) {
  return request({
    url: '/business/deviceCategory',
    method: 'post',
    data: data
  })
}

// 修改设备分类
export function updateDeviceCategory(data) {
  return request({
    url: '/business/deviceCategory',
    method: 'put',
    data: data
  })
}

// 删除设备分类
export function delDeviceCategory(categoryId) {
  return request({
    url: '/business/deviceCategory/' + categoryId,
    method: 'delete'
  })
}

// 导出设备分类
export function exportDeviceCategory(query) {
  return request({
    url: '/business/deviceCategory/export',
    method: 'get',
    params: query
  })
}
