Quellcode durchsuchen

设备扩展信息字段增加

jingyuanchao vor 11 Monaten
Ursprung
Commit
e1ed9ab070

+ 14 - 0
project_data/sql/1.0.11/soc.sql

@@ -122,6 +122,20 @@ BEGIN
                 ADD COLUMN `enable` int NULL DEFAULT 0 COMMENT '0:启用,1:禁用' AFTER `module_address`;
         end if;
 
+        IF NOT EXISTS(SELECT *
+                      FROM information_schema.columns
+                      WHERE table_schema = DATABASE()
+                        AND table_name = 'iot_device_info_extend'
+                        AND column_name = 'listen_address') THEN
+            ALTER TABLE `iot_device_info_extend`
+                ADD COLUMN `listen_address` varchar(255) NULL COMMENT '监听地址' AFTER `update_by`,
+                ADD COLUMN `listen_port` int(11) NULL COMMENT '监听端口' AFTER `listen_address`,
+                ADD COLUMN `device_mac` varchar(255) NULL COMMENT '设备mac地址' AFTER `listen_port`,
+                ADD COLUMN `device_user_code` varchar(255) NULL COMMENT '主机操作码' AFTER `device_mac`,
+                ADD COLUMN `iot_address` varchar(255) NULL COMMENT '控制地址' AFTER `device_user_code`,
+                ADD COLUMN `host_device_type` varchar(255) NULL COMMENT '主机类型' AFTER `iot_address`;
+        end if;
+
 
 
 

+ 19 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/iot/IotDeviceInfoExtend.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.xunmei.common.core.web.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
@@ -41,4 +42,22 @@ public class IotDeviceInfoExtend extends BaseEntity {
      * iotToken
      */
     private String iotToken;
+
+    @ApiModelProperty(value = "监听地址")
+    private String listenAddress;
+
+    @ApiModelProperty(value = "监听端口")
+    private Integer listenPort;
+
+    @ApiModelProperty(value = "设备mac地址")
+    private String deviceMac;
+
+    @ApiModelProperty(value = "主机操作码")
+    private String deviceUserCode;
+
+    @ApiModelProperty(value = "控制地址")
+    private String iotAddress;
+
+    @ApiModelProperty(value = "主机类型")
+    private String hostDeviceType;
 }

+ 1 - 1
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotDeviceInfoServiceImpl.java

@@ -129,7 +129,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
     @Override
     public List<IotServerProduct> getProductDisplayName(String type) {
         final LambdaQueryWrapper<IotServerProduct> wrapper = new LambdaQueryWrapper<>();
-        wrapper.like(IotServerProduct::getName, type);
+        wrapper.like(IotServerProduct::getCategories, type);
         return productMapper.selectList(wrapper);
     }