瀏覽代碼

更新!

TRX 1 年之前
父節點
當前提交
a206166e0a

+ 26 - 0
src/main/java/com/github/microservice/dataConfig/IotIdentifierConfig.java

@@ -1,5 +1,10 @@
 package com.github.microservice.dataConfig;
 
+import com.github.microservice.iot.InitIotParam;
+import com.github.microservice.types.FunctionType;
+
+import java.util.HashMap;
+
 /**
  * @author TRX
  * @date 2024/10/16
@@ -9,7 +14,28 @@ public class IotIdentifierConfig {
     // 通知权限发生变化 标识符
     public static final String permissionNotice = "permissionNotice";
 
+    // 取得设备关联的用户信息
+    public static final String queryDeviceBindUsers = "queryDeviceBindUsers";
+
+    // 取得设备关联的用户详情信息
+    public static final String queryDeviceUsersInfo = "queryDeviceUsersInfo";
+
+
     // 单次通知网关设备权限发生变化的设备数量
     public static final int maxNoticeSize = 200;
 
+    public static HashMap<String, InitIotParam> map = new HashMap<>();
+
+    static {
+        map.put(permissionNotice, InitIotParam.builder()
+                .name("网关设备权限变更通知").identifier(permissionNotice).iotTopic("/v1/gateway/${gateWayId}/permissionNotice").functionType(FunctionType.Server).build());
+
+        map.put(queryDeviceBindUsers, InitIotParam.builder()
+                .name("查询设备权限").identifier(queryDeviceBindUsers).iotTopic("/v1/gateway/${gateWayId}/queryDeviceBindUsers").functionType(FunctionType.Event).build());
+
+        map.put(queryDeviceUsersInfo, InitIotParam.builder()
+                .name("查询设备对应的用户信息").identifier(queryDeviceUsersInfo).iotTopic("/v1/gateway/${gateWayId}/queryDeviceUsersInfo").functionType(FunctionType.Event).build());
+
+    }
+
 }

+ 35 - 0
src/main/java/com/github/microservice/iot/InitIotParam.java

@@ -0,0 +1,35 @@
+package com.github.microservice.iot;
+
+import com.github.microservice.types.FunctionType;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/10/18
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class InitIotParam {
+
+    @Schema(description = "功能名称", required = true)
+    private String name;
+
+    @Schema(description = "标识符", required = true)
+    private String identifier;
+
+    @Schema(description = "功能类型,属性 事件 服务", required = true)
+    private FunctionType functionType;
+
+    @Schema(description = "物模型Topic")
+    private String iotTopic;
+
+    @Schema(description = "备注")
+    private String remark;
+
+}