|
|
@@ -0,0 +1,124 @@
|
|
|
+package com.zhongshu.iot.client.model.iot;
|
|
|
+
|
|
|
+import com.zhongshu.iot.client.model.baseParam.SuperModel;
|
|
|
+import com.zhongshu.iot.client.type.DataType;
|
|
|
+import com.zhongshu.iot.client.type.EventType;
|
|
|
+import com.zhongshu.iot.client.type.FunctionType;
|
|
|
+import com.zhongshu.iot.client.type.OperationType;
|
|
|
+import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author TRX
|
|
|
+ * @date 2024/6/20
|
|
|
+ */
|
|
|
+@Data
|
|
|
+@AllArgsConstructor
|
|
|
+@NoArgsConstructor
|
|
|
+public class IotMainModel extends SuperModel {
|
|
|
+
|
|
|
+ @Schema(description = "功能名称")
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ @Schema(description = "标识符")
|
|
|
+ private String identifier;
|
|
|
+
|
|
|
+ @Schema(description = "功能类型,属性 事件 服务")
|
|
|
+ FunctionType functionType;
|
|
|
+
|
|
|
+ @Schema(description = "物模型Topic")
|
|
|
+ private String iotTopic;
|
|
|
+
|
|
|
+ @Schema(description = "真实的topic")
|
|
|
+ private String realIotTopic;
|
|
|
+
|
|
|
+ @Schema(description = "是否返回数据")
|
|
|
+ private Boolean isReturnData = Boolean.TRUE;
|
|
|
+
|
|
|
+ private String functionTypeStr;
|
|
|
+
|
|
|
+ public String getFunctionTypeStr() {
|
|
|
+ if (functionType != null) {
|
|
|
+ return functionType.getRemark();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Schema(description = "所属模版")
|
|
|
+ IotTemplateModel iotTemplate;
|
|
|
+
|
|
|
+ @Schema(description = "设备操作权限")
|
|
|
+ private OperationType operationType;
|
|
|
+
|
|
|
+ private String operationTypeStr;
|
|
|
+
|
|
|
+ public String getOperationTypeStr() {
|
|
|
+ if (operationType != null) {
|
|
|
+ return operationType.getRemark();
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+
|
|
|
+ @Schema(description = "元素类型,只有 dataType=Array才使用")
|
|
|
+ private DataType elementType;
|
|
|
+
|
|
|
+ private String dataTypeStr;
|
|
|
+
|
|
|
+ public String getDataTypeStr() {
|
|
|
+ if (dataType != null) {
|
|
|
+ return dataType.getRemark();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Schema(description = "单位名称,如:千克、流明、立方米等...")
|
|
|
+ private String unitName;
|
|
|
+
|
|
|
+ @Schema(description = "步长")
|
|
|
+ private BigDecimal stepNumber;
|
|
|
+
|
|
|
+ @Schema(description = "最大的长度,如:类型为字符串时使用")
|
|
|
+ private Integer maxLength;
|
|
|
+
|
|
|
+ @Schema(description = "开始值")
|
|
|
+ private BigDecimal start;
|
|
|
+
|
|
|
+ @Schema(description = "结束值")
|
|
|
+ private BigDecimal end;
|
|
|
+
|
|
|
+ @Schema(description = "属性,参数列表,输入参数")
|
|
|
+ private List<IotAttribute> childs;
|
|
|
+
|
|
|
+ @Schema(description = "值的对应,如:0-开")
|
|
|
+ private List<IotDict> dicts;
|
|
|
+
|
|
|
+ @Schema(description = "属性,输出参数列表,输入参数")
|
|
|
+ private List<IotAttribute> outChilds;
|
|
|
+
|
|
|
+ //--------------------------------关联设备时特有的属性 start------------------
|
|
|
+
|
|
|
+ @Schema(description = "业务处理地址")
|
|
|
+ private String remoteUrl;
|
|
|
+
|
|
|
+}
|