device.js 765 B

1234567891011121314151617
  1. const {request} = require('../https/request.js')
  2. module.exports = {
  3. //添加设备
  4. postDevice: (params) => request('/devices', 'POST', params),
  5. //获取设备信息
  6. getDevice: (Device,Group) => request('/devices?id=' + Device + '&group_id='+ Group, 'GET'),
  7. //修改设备
  8. putDevice: (params) => request('/devices', 'PUT', params),
  9. //删除设备
  10. delDevice: (Device) => request('/devices?id=' + Device,'DELETE'),
  11. //获取回路参数
  12. getloop:(Device) => request('/devices/relays?id=' + Device,'GET'),
  13. //控制回路开关
  14. loopSwitch:(params)=>request('/devices/operation','POST',params),
  15. //获取回路的开关状态
  16. loopSwitchstate:(Device,relayid)=>request('/devices/relays/status?device_id='+ Device + '&relay_ids=' + relayid,'GET')
  17. }