import request from '@/utils/request';

export function getList(data) {
  const param = '?page=' + data.page + '&size=' + data.size;
  return request({
    url: '/sysDict/select' + param,
    method: 'get',
    data,
  });
}

export function doEdit(data) {
  return request({
    url: '/sysDict/updateDictType',
    method: 'post',
    data,
  });
}

export function doDelete(data) {
  return request({
    url: '/sysDict/removeDictType?dictTypeId=' + data.dictTypeId,
    method: 'post',
    data,
  });
}

export function doAdd(data) {
  return request({
    url: '/sysDict/insertDictType',
    method: 'post',
    data,
  });
}

export function selectDeviceInfo(data) {
  return request({
    url: '/iot/device/selectDeviceInfo?deviceId=' + data.deviceId,
    method: 'post',
    data,
  });
}

export function insertDictData(data) {
  return request({
    url: '/sysDict/insertDictData',
    method: 'post',
    data,
  });
}

export function updateDictData(data) {
  return request({
    url: '/sysDict/updateDictData',
    method: 'post',
    data,
  });
}

export function removeDictData(data) {
  return request({
    url: '/sysDict/removeDictData?dictDataId=' + data.dictDataId,
    method: 'post',
    data,
  });
}
