xucaiqin 1 жил өмнө
parent
commit
6318291233

+ 2 - 2
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/constant/UrlProtocol.java

@@ -5,6 +5,6 @@ package com.middle.platform.manage.biz.constant;
  * @date 2023-12-21 09:23:36
  */
 public interface UrlProtocol {
-    Integer MQTT = 1;
-    Integer HTTP = 2;
+    String MQTT = "1";
+    String HTTP = "2";
 }

+ 3 - 2
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotUrlService.java

@@ -1,6 +1,7 @@
 package com.middle.platform.manage.biz.service;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -221,7 +222,7 @@ public class IotUrlService {
      * @param iotProduct 产品信息
      */
     public void save(IotProduct iotProduct) {
-        if (Objects.equals(iotProduct.getReportProtocol(), UrlProtocol.MQTT)) {
+        if (StrUtil.equals(iotProduct.getReportProtocol(), UrlProtocol.MQTT)) {
             for (UrlInit value : UrlInit.values()) {
                 IotUrl iotUrl = new IotUrl();
                 iotUrl.setProductId(iotProduct.getId());
@@ -232,7 +233,7 @@ public class IotUrlService {
                 iotUrl.setType(iotProduct.getReportProtocol());
                 iotUrl.setRemark(value.getDesc());
                 iotUrlMapper.insert(iotUrl);
-                subUrl(iotUrl.getUrl(), iotUrl.getFunc() + String.valueOf(iotUrl.getPermission()));
+                subUrl(iotUrl.getUrl(), iotUrl.getFunc() + iotUrl.getPermission());
             }
         }
         //http