import request from '@/config/axios'

// 查询产品分类列表
export function listCategory(query) {
  return request.get({
    url: '/rq/iot-category/list',
   
    params: query
  })
}

// 查询产品简短分类列表
export function listShortCategory(query) {
  return request.get({
    url: '/rq/iot-category/shortlist',
  
    params: query,
  })
}

// 查询产品分类详细
export function getCategory(categoryId) {
  return request.get({
    url: '/rq/iot-category/' + categoryId,
 
  })
}

// 新增产品分类
export function addCategory(data) {
  return request.post({
    url: '/rq/iot-category',
    
    data: data
  })
}

// 修改产品分类
export function updateCategory(data) {
  return request.put({
    url: '/rq/iot-category',
  
    data: data
  })
}

// 删除产品分类
export function delCategory(categoryId) {
  return request.delete({
    url: `/rq/iot-category/delete?id=${categoryId}`
  
  })
}
