TRX 1 rok pred
rodič
commit
0631ba677a

+ 6 - 0
src/main/java/com/zswl/dataservice/domain/iot/IotMain.java

@@ -38,6 +38,9 @@ public class IotMain extends SuperEntity {
     @Schema(description = "标识符")
     private String identifier;
 
+    @Schema(description = "事件类型")
+    private EventType eventType;
+
     @Schema(description = "物模型Topic")
     private String iotTopic;
 
@@ -82,6 +85,9 @@ public class IotMain extends SuperEntity {
     @Schema(description = "值的对应,如:0-开")
     private List<IotDict> dicts;
 
+    @Schema(description = "属性,输出参数列表,输入参数")
+    private List<IotAttribute> outChilds;
+
     //--------------------------------关联设备时特有的属性 start------------------
     @Schema(description = "区分是模版还是设备关联的物模型")
     private IotDataType iotDataType;

+ 16 - 4
src/main/java/com/zswl/dataservice/model/iot/IotMainModel.java

@@ -2,10 +2,7 @@ package com.zswl.dataservice.model.iot;
 
 import com.zswl.dataservice.domain.iot.IotTemplate;
 import com.zswl.dataservice.model.baseParam.SuperModel;
-import com.zswl.dataservice.type.DataType;
-import com.zswl.dataservice.type.FunctionType;
-import com.zswl.dataservice.type.MainUnitType;
-import com.zswl.dataservice.type.OperationType;
+import com.zswl.dataservice.type.*;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotEmpty;
 import lombok.AllArgsConstructor;
@@ -68,6 +65,18 @@ public class IotMainModel extends SuperModel {
         return "";
     }
 
+    @Schema(description = "事件类型")
+    private EventType eventType;
+
+    private String eventTypeStr;
+
+    public String getEventTypeStr() {
+        if (eventType != null) {
+            return eventType.getRemark();
+        }
+        return "";
+    }
+
     //---------------------------------属性类型的  字段  start ------------------
     @Schema(description = "数据类型,number、Boolean、String 等")
     private DataType dataType;
@@ -105,6 +114,9 @@ public class IotMainModel extends SuperModel {
     @Schema(description = "值的对应,如:0-开")
     private List<IotDict> dicts;
 
+    @Schema(description = "属性,输出参数列表,输入参数")
+    private List<IotAttribute> outChilds;
+
     //--------------------------------关联设备时特有的属性 start------------------
 
     @Schema(description = "业务处理地址")

+ 7 - 0
src/main/java/com/zswl/dataservice/model/iot/IotMainParam.java

@@ -2,6 +2,7 @@ package com.zswl.dataservice.model.iot;
 
 import com.zswl.dataservice.model.baseParam.SuperParam;
 import com.zswl.dataservice.type.DataType;
+import com.zswl.dataservice.type.EventType;
 import com.zswl.dataservice.type.FunctionType;
 import com.zswl.dataservice.type.MainUnitType;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -43,6 +44,9 @@ public class IotMainParam extends SuperParam {
     @Schema(description = "元素类型,只有 dataType=Array才使用,当elementType=String、Number, 元素值的限制 设置到 本级,childs 应该为空")
     private DataType elementType;
 
+    @Schema(description = "事件类型")
+    private EventType eventType;
+
     @Schema(description = "单位名称,如:千克、流明、立方米等...")
     private String unitName;
 
@@ -64,6 +68,9 @@ public class IotMainParam extends SuperParam {
     @Schema(description = "值的对应,如:0-开,")
     private List<IotDict> dicts;
 
+    @Schema(description = "属性,输出参数列表,输入参数")
+    private List<IotAttribute> outChilds;
+
     @Schema(description = "业务处理地址")
     private String remoteUrl;
 

+ 20 - 0
src/main/java/com/zswl/dataservice/type/EventType.java

@@ -0,0 +1,20 @@
+package com.zswl.dataservice.type;
+
+import lombok.Getter;
+
+/**
+ * 事件类型
+ */
+public enum EventType {
+    Info("消息"),
+    Warn("警告"),
+    Error("故障"),
+    ;
+
+    @Getter
+    private String remark;
+
+    EventType(String remark) {
+        this.remark = remark;
+    }
+}