TRX 1 年間 前
コミット
bc06256b35

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

@@ -18,19 +18,19 @@ import java.util.List;
 @NoArgsConstructor
 public class IotAttribute {
 
-    @Schema(description = "数据,如:数字,字符串 ...")
+    @Schema(description = "数据,如:数字,字符串 ...", required = true)
     private DataType dataType;
 
     @Schema(description = "元素类型,只有 dataType=Array才使用")
     private DataType elementType;
 
-    @Schema(description = "参数描述,如:姓名")
+    @Schema(description = "参数描述,如:姓名", required = true)
     private String name;
 
-    @Schema(description = "参数名称,如:name")
+    @Schema(description = "参数名称,如:name", required = true)
     private String identifier;
 
-    @Schema(description = "是否必须", required = true)
+    @Schema(description = "是否必须", required = false, hidden = true)
     private Boolean required = Boolean.TRUE;
 
     @Schema(description = "单位名称,如:千克、流明、立方米等...")

+ 2 - 2
src/main/java/com/zswl/dataservice/model/iot/IotDict.java

@@ -14,9 +14,9 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public class IotDict {
 
-    @Schema(description = "参数值,如:0")
+    @Schema(description = "参数值,如:0", required = true)
     private String value;
 
-    @Schema(description = "描述,如:开")
+    @Schema(description = "描述,如:开", required = true)
     private String desc;
 }

+ 6 - 0
src/main/java/com/zswl/dataservice/model/iot/IotMainModel.java

@@ -93,6 +93,12 @@ public class IotMainModel extends SuperModel {
     @Schema(description = "最大的长度,如:类型为字符串时使用")
     private Integer maxLength;
 
+    @Schema(description = "开始值")
+    private BigDecimal start;
+
+    @Schema(description = "结束值")
+    private BigDecimal end;
+
     @Schema(description = "属性,参数列表,输入参数")
     private List<IotAttribute> childs;
 

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

@@ -25,19 +25,19 @@ public class IotMainParam extends SuperParam {
     @Schema(description = "模版或无模型ID")
     private String iotTemplateId;
 
-    @Schema(description = "功能名称")
+    @Schema(description = "功能名称", required = true)
     private String name;
 
-    @Schema(description = "标识符")
+    @Schema(description = "标识符", required = true)
     private String identifier;
 
-    @Schema(description = "功能类型,属性 事件 服务")
+    @Schema(description = "功能类型,属性 事件 服务", required = true)
     FunctionType functionType;
 
     @Schema(description = "物模型Topic")
     private String iotTopic;
 
-    @Schema(description = "数据类型,number、Boolean、String 等")
+    @Schema(description = "数据类型,number、Boolean、String 等", required = true)
     private DataType dataType;
 
     @Schema(description = "元素类型,只有 dataType=Array才使用,当elementType=String、Number, 元素值的限制 设置到 本级,childs 应该为空")
@@ -47,7 +47,7 @@ public class IotMainParam extends SuperParam {
     private String unitName;
 
     @Schema(description = "步长")
-    private Integer stepNumber;
+    private BigDecimal stepNumber;
 
     @Schema(description = "开始值")
     private BigDecimal start;

+ 3 - 3
src/main/java/com/zswl/dataservice/service/artemis/OperationMessageService.java

@@ -81,7 +81,7 @@ public class OperationMessageService {
 
     @Autowired
     private DeviceInfoDao deviceInfoDao;
-    
+
     // 保存90天
     @Value("${artemisstore.time}")
     private Long ttlMill = 30 * 24L * 60 * 60 * 1000L;
@@ -236,7 +236,7 @@ public class OperationMessageService {
             if (System.currentTimeMillis() > (time + ttl)) {
                 isTimeOut = true;
             }
-            log.info("textMessage: {}", msg);
+            log.info("消息内容: {}", msg);
 
             String timeStr = DateUtils.paresTime(time, DateUtils.patternyyyySSS);
             jsonObject.set("timeStr", timeStr);
@@ -260,7 +260,7 @@ public class OperationMessageService {
             }
             initAddOperationMessage(operationMessage);
         } catch (Exception e) {
-            log.error(msg);
+            log.error("消息出错了: {}", msg);
             e.printStackTrace();
         }
     }

+ 1 - 0
src/main/java/com/zswl/dataservice/service/iot/IotServiceImpl.java

@@ -358,6 +358,7 @@ public class IotServiceImpl extends SuperService {
             }
         } else {
             entity = new IotMain();
+            initEntity(entity);
             if (ObjectUtils.isNotEmpty(nameTemp)) {
                 return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
             }