constants.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /** iot 依赖注入 KEY */
  2. export const IOT_PROVIDE_KEY = {
  3. PRODUCT: 'IOT_PRODUCT'
  4. }
  5. /**
  6. * IoT 设备消息的方法枚举
  7. */
  8. export const IotDeviceMessageMethodEnum = {
  9. // ========== 设备状态 ==========
  10. STATE_UPDATE: {
  11. method: 'thing.state.update',
  12. name: '设备状态变更',
  13. upstream: true
  14. },
  15. // ========== 设备属性 ==========
  16. PROPERTY_POST: {
  17. method: 'thing.property.post',
  18. name: '属性上报',
  19. upstream: true
  20. },
  21. PROPERTY_SET: {
  22. method: 'thing.property.set',
  23. name: '属性设置',
  24. upstream: false
  25. },
  26. // ========== 设备事件 ==========
  27. EVENT_POST: {
  28. method: 'thing.event.post',
  29. name: '事件上报',
  30. upstream: true
  31. },
  32. // ========== 服务调用 ==========
  33. SERVICE_INVOKE: {
  34. method: 'thing.service.invoke',
  35. name: '服务调用',
  36. upstream: false
  37. },
  38. // ========== 设备配置 ==========
  39. CONFIG_PUSH: {
  40. method: 'thing.config.push',
  41. name: '配置推送',
  42. upstream: false
  43. }
  44. }
  45. // IOT 产品物模型类型枚举类
  46. export const IotThingModelTypeEnum = {
  47. PROPERTY: 1, // 属性
  48. SERVICE: 2, // 服务
  49. EVENT: 3 // 事件
  50. }