import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
  let param = '?page=' + data.page + '&size=' + data.size;
  if (data.name != '' && data.name != undefined) {
    param += '&name=' + data.name;
  }
  if (data.materialCode != '' && data.materialCode != undefined) {
    param += '&materialCode=' + data.materialCode;
  }
  return request({
    url: '/productCategory/list' + param,
    method: 'get',
    data,
  });
}
//注册设备
export function addData(data) {
  return request({
    url: '/productCategory/add',
    method: 'post',
    data,
  });
}
//删除设备
export function updateData(data) {
  return request({
    url: '/productCategory/update',
    method: 'post',
    data,
  });
}
export function delectData(ids) {
  return request({
    url: '/productCategory/delete/' + ids,
    method: 'post',
  });
}
//配置产品参数
export function addAttribute(data) {
  return request({
    url: '/productCategory/addAttribute',
    method: 'post',
    data,
  });
}
export function getAttribute(id) {
  return request({
    url: '/productCategory/getAttribute/' + id,
    method: 'get',
  });
}
