1. 剔除掉多余的文档以及标记

This commit is contained in:
chenbowen
2025-11-28 18:12:00 +08:00
parent 30bd4810f5
commit 0c22975df0
432 changed files with 705 additions and 1650200 deletions

View File

@@ -20,7 +20,7 @@
<name>${project.artifactId}</name>
<description>
物联网模块
<!-- TODO 芋艿:需要补充下说明! -->
<!-- TODO ZT:需要补充下说明! -->
</description>
</project>

View File

@@ -12,7 +12,7 @@
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<!-- TODO 芋艿:需要在整理下,特别是 PF4J -->
<!-- TODO ZT:需要在整理下,特别是 PF4J -->
<description>
物联网 模块 API暴露给其它模块调用
</description>

View File

@@ -44,7 +44,7 @@ public interface IotDeviceUpstreamApi {
@PostMapping(PREFIX + "/report-event")
CommonResult<Boolean> reportDeviceEvent(@Valid @RequestBody IotDeviceEventReportReqDTO reportReqDTO);
// TODO @芋艿:这个需要 plugins 接入下
// TODO @ZT:这个需要 plugins 接入下
/**
* 注册设备
*
@@ -53,7 +53,7 @@ public interface IotDeviceUpstreamApi {
@PostMapping(PREFIX + "/register")
CommonResult<Boolean> registerDevice(@Valid @RequestBody IotDeviceRegisterReqDTO registerReqDTO);
// TODO @芋艿:这个需要 plugins 接入下
// TODO @ZT:这个需要 plugins 接入下
/**
* 注册子设备
*
@@ -62,7 +62,7 @@ public interface IotDeviceUpstreamApi {
@PostMapping(PREFIX + "/register-sub")
CommonResult<Boolean> registerSubDevice(@Valid @RequestBody IotDeviceRegisterSubReqDTO registerReqDTO);
// TODO @芋艿:这个需要 plugins 接入下
// TODO @ZT:这个需要 plugins 接入下
/**
* 注册设备拓扑
*
@@ -71,7 +71,7 @@ public interface IotDeviceUpstreamApi {
@PostMapping(PREFIX + "/add-topology")
CommonResult<Boolean> addDeviceTopology(@Valid @RequestBody IotDeviceTopologyAddReqDTO addReqDTO);
// TODO @芋艿:考虑 http 认证
// TODO @ZT:考虑 http 认证
/**
* 认证 Emqx 连接
*

View File

@@ -5,8 +5,8 @@ import lombok.Data;
import java.util.List;
// TODO @芋艿:从 server => plugin => device 是否有必要?从阿里云 iot 来看,没有这个功能?!
// TODO @芋艿:是不是改成 read 更好?在看看阿里云的 topic 设计
// TODO @ZT:从 server => plugin => device 是否有必要?从阿里云 iot 来看,没有这个功能?!
// TODO @ZT:是不是改成 read 更好?在看看阿里云的 topic 设计
/**
* IoT 设备【属性】获取 Request DTO
*

View File

@@ -3,8 +3,8 @@ package com.zt.plat.module.iot.api.device.dto.control.upstream;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
// TODO @芋艿:要不要继承 IotDeviceUpstreamAbstractReqDTO
// TODO @芋艿@haohao后续其它认证的设计
// TODO @ZT:要不要继承 IotDeviceUpstreamAbstractReqDTO
// TODO @ZT@haohao后续其它认证的设计
/**
* IoT 认证 Emqx 连接 Request DTO
*

View File

@@ -2,7 +2,7 @@ package com.zt.plat.module.iot.api.device.dto.control.upstream;
import lombok.Data;
// TODO @芋艿:待实现:/ota/${productKey}/${deviceName}/progress
// TODO @ZT:待实现:/ota/${productKey}/${deviceName}/progress
/**
* IoT 设备【OTA】升级进度 Request DTO上报更新固件进度
*

View File

@@ -1,6 +1,6 @@
package com.zt.plat.module.iot.api.device.dto.control.upstream;
// TODO @芋艿:待实现:/ota/${productKey}/${deviceName}/pull
// TODO @ZT:待实现:/ota/${productKey}/${deviceName}/pull
/**
* IoT 设备【OTA】升级下拉 Request DTO拉取固件更新
*

View File

@@ -1,6 +1,6 @@
package com.zt.plat.module.iot.api.device.dto.control.upstream;
// TODO @芋艿:待实现:/ota/${productKey}/${deviceName}/report
// TODO @ZT:待实现:/ota/${productKey}/${deviceName}/report
/**
* IoT 设备【OTA】上报 Request DTO上报固件版本
*

View File

@@ -13,7 +13,7 @@ import java.util.List;
@Data
public class IotDeviceRegisterSubReqDTO extends IotDeviceUpstreamAbstractReqDTO {
// TODO @芋艿:看看要不要优化命名
// TODO @ZT:看看要不要优化命名
/**
* 子设备数组
*/

View File

@@ -5,14 +5,14 @@ import lombok.Data;
import java.util.List;
// TODO @芋艿:要写清楚,是来自设备网关,还是设备。
// TODO @ZT:要写清楚,是来自设备网关,还是设备。
/**
* IoT 设备【拓扑】添加 Request DTO
*/
@Data
public class IotDeviceTopologyAddReqDTO extends IotDeviceUpstreamAbstractReqDTO {
// TODO @芋艿:看看要不要优化命名
// TODO @ZT:看看要不要优化命名
/**
* 子设备数组
*/
@@ -37,7 +37,7 @@ public class IotDeviceTopologyAddReqDTO extends IotDeviceUpstreamAbstractReqDTO
@NotEmpty(message = "设备名称不能为空")
private String deviceName;
// TODO @芋艿:阿里云还有 sign 签名
// TODO @ZT:阿里云还有 sign 签名
}

View File

@@ -1,4 +1,4 @@
/**
* TODO 芋艿:占位
* TODO ZT:占位
*/
package com.zt.plat.module.iot.api.device.dto;

View File

@@ -1,6 +1,6 @@
/**
* 占位
*
* TODO 芋艿:后续删除
* TODO ZT:后续删除
*/
package com.zt.plat.module.iot.api;

View File

@@ -3,7 +3,7 @@ package com.zt.plat.module.iot.enums.device;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
// TODO @芋艿:需要添加对应的 DTO以及上下行的链路网关、网关服务、设备等
// TODO @ZT:需要添加对应的 DTO以及上下行的链路网关、网关服务、设备等
/**
* IoT 设备消息标识符枚举
*/
@@ -11,18 +11,18 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum IotDeviceMessageIdentifierEnum {
PROPERTY_GET("get"), // 下行 TODO 芋艿【讨论】貌似这个“上行”更合理device 主动拉取配置。和 IotDevicePropertyGetReqDTO 一样的配置
PROPERTY_GET("get"), // 下行 TODO ZT【讨论】貌似这个“上行”更合理device 主动拉取配置。和 IotDevicePropertyGetReqDTO 一样的配置
PROPERTY_SET("set"), // 下行
PROPERTY_REPORT("report"), // 上行
STATE_ONLINE("online"), // 上行
STATE_OFFLINE("offline"), // 上行
CONFIG_GET("get"), // 上行 TODO 芋艿:【讨论】暂时没有上行的场景
CONFIG_GET("get"), // 上行 TODO ZT:【讨论】暂时没有上行的场景
CONFIG_SET("set"), // 下行
SERVICE_INVOKE("${identifier}"), // 下行
SERVICE_REPLY_SUFFIX("_reply"), // 芋艿TODO 芋艿:【讨论】上行 or 下行
SERVICE_REPLY_SUFFIX("_reply"), // ZTTODO ZT:【讨论】上行 or 下行
OTA_UPGRADE("upgrade"), // 下行
OTA_PULL("pull"), // 上行

View File

@@ -15,7 +15,7 @@
<name>${project.artifactId}</name>
<description>
物联网 模块,主要实现 产品管理、设备管理、协议管理等功能。
<!-- TODO 芋艿:后续补充下 -->
<!-- TODO ZT:后续补充下 -->
</description>
<dependencies>
@@ -99,7 +99,7 @@
<artifactId>zt-spring-boot-starter-job</artifactId>
</dependency>
<!-- TODO @芋艿:引入下,看看情况 -->
<!-- TODO @ZT:引入下,看看情况 -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
@@ -130,7 +130,7 @@
<artifactId>zt-spring-boot-starter-monitor</artifactId>
</dependency>
<!-- 消息队列相关 TODO 芋艿:需要整理 -->
<!-- 消息队列相关 TODO ZT:需要整理 -->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
@@ -152,7 +152,7 @@
<artifactId>pf4j-spring</artifactId>
</dependency>
<!-- TODO @芋艿bom 管理 -->
<!-- TODO @ZTbom 管理 -->
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-all</artifactId>
@@ -160,7 +160,7 @@
<type>pom</type>
</dependency>
<!-- TODO @芋艿bom 管理 -->
<!-- TODO @ZTbom 管理 -->
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
@@ -173,7 +173,7 @@
<version>24.1.2</version>
</dependency>
<!-- TODO @芋艿:合理注释 -->
<!-- TODO @ZT:合理注释 -->
<!-- IoT 数据桥梁的执行器所需消息队列。如果您只需要使用 rocketmq 那么则注释掉其它消息队列即可 -->
<!-- <dependency>-->
<!-- <groupId>org.apache.rocketmq</groupId>-->

View File

@@ -6,7 +6,7 @@ import javax.script.ScriptEngine;
import javax.script.ScriptException;
/**
* TODO 芋艿:测试脚本的接入
* TODO ZT:测试脚本的接入
*/
public class ScriptTest {

View File

@@ -1,6 +1,6 @@
/**
* 占位
*
* TODO 芋艿:后续删除
* TODO ZT:后续删除
*/
package com.zt.plat.module.iot.api;

View File

@@ -61,7 +61,7 @@ public class IotDeviceController {
return success(true);
}
// TODO @芋艿参考阿里云1绑定网关2解绑网关
// TODO @ZT参考阿里云1绑定网关2解绑网关
@PutMapping("/update-group")
@Operation(summary = "更新设备分组")

View File

@@ -14,7 +14,7 @@ public class IotDeviceMqttConnectionParamsRespVO {
@ExcelProperty("MQTT 客户端 ID")
private String mqttClientId;
@Schema(description = "MQTT 用户名", example = "芋艿")
@Schema(description = "MQTT 用户名", example = "ZT")
@ExcelProperty("MQTT 用户名")
private String mqttUsername;

View File

@@ -1,2 +1,2 @@
// TODO @芋艿:占位
// TODO @ZT:占位
package com.zt.plat.module.iot.controller.admin.rule.vo;

View File

@@ -120,7 +120,7 @@ public class IotDeviceDO extends TenantBaseDO {
*/
private String firmwareId;
// TODO @芋艿:【待定 003】要不要增加 username目前 tl 有,阿里云之类的没有
// TODO @ZT:【待定 003】要不要增加 username目前 tl 有,阿里云之类的没有
/**
* 设备密钥,用于设备认证,需安全存储
*/
@@ -143,7 +143,7 @@ public class IotDeviceDO extends TenantBaseDO {
// TODO @haohao是不是要枚举哈
private String authType;
// TODO @芋艿:【待定 002】1设备维护的时候设置位置类似 tl2设备上传的时候设置位置类似 it
// TODO @ZT:【待定 002】1设备维护的时候设置位置类似 tl2设备上传的时候设置位置类似 it
/**
* 设备位置的纬度
*/

View File

@@ -45,7 +45,7 @@ public class IotPluginConfigDO extends TenantBaseDO {
* 枚举 {@link IotPluginDeployTypeEnum}
*/
private Integer deployType;
// TODO @芋艿如果是外置的插件fileName 和 version 的选择~
// TODO @ZT如果是外置的插件fileName 和 version 的选择~
/**
* 插件包文件名
*/
@@ -54,7 +54,7 @@ public class IotPluginConfigDO extends TenantBaseDO {
* 插件版本
*/
private String version;
// TODO @芋艿type 字典的定义
// TODO @ZTtype 字典的定义
/**
* 插件类型
* <p>
@@ -64,7 +64,7 @@ public class IotPluginConfigDO extends TenantBaseDO {
/**
* 设备插件协议类型
*/
// TODO @芋艿:枚举字段
// TODO @ZT:枚举字段
private String protocol;
// TODO @haohao这个字段是不是直接用 CommonStatus开启、禁用然后插件实例那online 是否在线
/**
@@ -74,7 +74,7 @@ public class IotPluginConfigDO extends TenantBaseDO {
*/
private Integer status;
// TODO @芋艿configSchema、config 示例字段
// TODO @ZTconfigSchema、config 示例字段
/**
* 插件配置项描述信息
*/
@@ -84,7 +84,7 @@ public class IotPluginConfigDO extends TenantBaseDO {
*/
private String config;
// TODO @芋艿script 后续的使用
// TODO @ZTscript 后续的使用
/**
* 插件脚本
*/

View File

@@ -54,14 +54,14 @@ public class IotAlertRecordDO extends BaseDO {
*/
private String deviceName;
// TODO @芋艿:有没更好的方式
// TODO @ZT:有没更好的方式
/**
* 触发的设备消息
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private IotDeviceMessage deviceMessage;
// TODO @芋艿:换成枚举,枚举对应 ApiErrorLogProcessStatusEnum
// TODO @ZT:换成枚举,枚举对应 ApiErrorLogProcessStatusEnum
/**
* 处理状态
*

View File

@@ -25,7 +25,7 @@ public interface IotThingModelMapper extends BaseMapperX<IotThingModelDO> {
.likeIfPresent(IotThingModelDO::getName, reqVO.getName())
.eqIfPresent(IotThingModelDO::getType, reqVO.getType())
.eqIfPresent(IotThingModelDO::getProductId, reqVO.getProductId())
// TODO @芋艿:看看要不要加枚举
// TODO @ZT:看看要不要加枚举
.notIn(IotThingModelDO::getIdentifier, "get", "set", "post")
.orderByDesc(IotThingModelDO::getId));
}
@@ -36,7 +36,7 @@ public interface IotThingModelMapper extends BaseMapperX<IotThingModelDO> {
.likeIfPresent(IotThingModelDO::getName, reqVO.getName())
.eqIfPresent(IotThingModelDO::getType, reqVO.getType())
.eqIfPresent(IotThingModelDO::getProductId, reqVO.getProductId())
// TODO @芋艿:看看要不要加枚举
// TODO @ZT:看看要不要加枚举
.notIn(IotThingModelDO::getIdentifier, "get", "set", "post")
.orderByDesc(IotThingModelDO::getId));
}

View File

@@ -26,7 +26,7 @@ public class IotPluginConfiguration {
return new IotPluginStartRunner(pluginManager, pluginConfigService);
}
// TODO @芋艿:需要 review 下
// TODO @ZT:需要 review 下
@Bean
public SpringPluginManager pluginManager(@Value("${pf4j.pluginsDir:pluginsDir}") String pluginsDir) {
log.info("[init][实例化 SpringPluginManager]");

View File

@@ -33,7 +33,7 @@ public class IotDeviceOfflineCheckJob {
/**
* 设备离线超时时间
*
* TODO 芋艿:暂定 10 分钟,后续看看要不要基于设备或者全局有配置文件
* TODO ZT:暂定 10 分钟,后续看看要不要基于设备或者全局有配置文件
*/
public static final Duration OFFLINE_TIMEOUT = Duration.ofMinutes(10);

View File

@@ -21,7 +21,7 @@ public class IotPluginInstancesJob {
/**
* 插件离线超时时间
*
* TODO 芋艿:暂定 10 分钟,后续看要不要做配置
* TODO ZT:暂定 10 分钟,后续看要不要做配置
*/
public static final Duration OFFLINE_TIMEOUT = Duration.ofMinutes(10);

View File

@@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
// TODO @芋艿:参考阿里云的物模型,优化 IoT 上下行消息的设计,尽量保持一致(渐进式,不要一口气)!
// TODO @ZT:参考阿里云的物模型,优化 IoT 上下行消息的设计,尽量保持一致(渐进式,不要一口气)!
/**
* IoT 设备消息
*/

View File

@@ -1,4 +1,4 @@
/**
* TODO 芋艿:临时占位
* TODO ZT:临时占位
*/
package com.zt.plat.module.iot.mq.producer;

View File

@@ -1,5 +1,5 @@
/**
* iot 模块,物联网 模块,主要实现 产品管理、设备管理、协议管理等功能。TODO 芋艿:完善下
* iot 模块,物联网 模块,主要实现 产品管理、设备管理、协议管理等功能。TODO ZT:完善下
*
* 1. Controller URL以 /iot/ 开头,避免和其它 Module 冲突
* 2. DataObject 表名:以 iot_ 开头,方便在数据库中区分

View File

@@ -47,7 +47,7 @@ public interface IotDeviceService {
*/
void updateDevice(@Valid IotDeviceSaveReqVO updateReqVO);
// TODO @芋艿:先这么实现。未来看情况,要不要自己实现
// TODO @ZT:先这么实现。未来看情况,要不要自己实现
/**
* 更新设备的所属网关

View File

@@ -57,8 +57,8 @@ public class IotDeviceDownstreamServiceImpl implements IotDeviceDownstreamServic
public IotDeviceMessage downstreamDevice(IotDeviceDownstreamReqVO downstreamReqVO) {
// 校验设备是否存在
IotDeviceDO device = deviceService.validateDeviceExists(downstreamReqVO.getId());
// TODO @芋艿:离线设备,不允许推送
// TODO 芋艿:父设备的处理
// TODO @ZT:离线设备,不允许推送
// TODO ZT:父设备的处理
IotDeviceDO parentDevice = null;
// 服务调用
@@ -88,7 +88,7 @@ public class IotDeviceDownstreamServiceImpl implements IotDeviceDownstreamServic
if (Objects.equals(downstreamReqVO.getType(), IotDeviceMessageTypeEnum.OTA.getType())) {
return otaUpgrade(downstreamReqVO, device, parentDevice);
}
// TODO @芋艿:取消设备的网关的时,要不要下发 REGISTER_UNREGISTER_SUB
// TODO @ZT:取消设备的网关的时,要不要下发 REGISTER_UNREGISTER_SUB
throw new IllegalArgumentException("不支持的下行消息类型:" + downstreamReqVO);
}

View File

@@ -111,7 +111,7 @@ public class IotDeviceUpstreamServiceImpl implements IotDeviceUpstreamService {
// 2. 更新设备状态
deviceService.updateDeviceState(device.getId(), updateReqDTO.getState());
// 3. TODO 芋艿:子设备的关联
// 3. TODO ZT:子设备的关联
// 4. 发送设备消息
IotDeviceMessage message = BeanUtils.toBean(updateReqDTO, IotDeviceMessage.class)
@@ -223,7 +223,7 @@ public class IotDeviceUpstreamServiceImpl implements IotDeviceUpstreamService {
if (CollUtil.isNotEmpty(registerReqDTO.getParams())) {
registerReqDTO.getParams().forEach(subDevice -> registerDevice0(
subDevice.getProductKey(), subDevice.getDeviceName(), device.getId(), registerReqDTO));
// TODO @芋艿:后续要处理,每个设备是否成功
// TODO @ZT:后续要处理,每个设备是否成功
}
// 3. 发送设备消息
@@ -259,7 +259,7 @@ public class IotDeviceUpstreamServiceImpl implements IotDeviceUpstreamService {
addReqDTO.getParams().forEach(subDevice -> {
IotDeviceDO subDeviceDO = deviceService.getDeviceByProductKeyAndDeviceNameFromCache(
subDevice.getProductKey(), subDevice.getDeviceName());
// TODO @芋艿:后续要处理,每个设备是否成功
// TODO @ZT:后续要处理,每个设备是否成功
if (subDeviceDO == null) {
log.error("[addDeviceTopology][子设备({}/{}) 不存在]",
subDevice.getProductKey(), subDevice.getDeviceName());
@@ -280,7 +280,7 @@ public class IotDeviceUpstreamServiceImpl implements IotDeviceUpstreamService {
sendDeviceMessage(message, device);
}
// TODO @芋艿后续需要考虑http 的认证
// TODO @ZT后续需要考虑http 的认证
@Override
public boolean authenticateEmqxConnection(IotDeviceEmqxAuthReqDTO authReqDTO) {
log.info("[authenticateEmqxConnection][认证 Emqx 连接: {}]", authReqDTO);

View File

@@ -51,12 +51,12 @@ public class IotDevicePropertyServiceImpl implements IotDevicePropertyService {
.put(IotDataSpecsDataTypeEnum.INT.getDataType(), TDengineTableField.TYPE_INT)
.put(IotDataSpecsDataTypeEnum.FLOAT.getDataType(), TDengineTableField.TYPE_FLOAT)
.put(IotDataSpecsDataTypeEnum.DOUBLE.getDataType(), TDengineTableField.TYPE_DOUBLE)
.put(IotDataSpecsDataTypeEnum.ENUM.getDataType(), TDengineTableField.TYPE_TINYINT) // TODO 芋艿:为什么要映射为 TINYINT 的说明?
.put(IotDataSpecsDataTypeEnum.BOOL.getDataType(), TDengineTableField.TYPE_TINYINT) // TODO 芋艿:为什么要映射为 TINYINT 的说明?
.put(IotDataSpecsDataTypeEnum.ENUM.getDataType(), TDengineTableField.TYPE_TINYINT) // TODO ZT:为什么要映射为 TINYINT 的说明?
.put(IotDataSpecsDataTypeEnum.BOOL.getDataType(), TDengineTableField.TYPE_TINYINT) // TODO ZT:为什么要映射为 TINYINT 的说明?
.put(IotDataSpecsDataTypeEnum.TEXT.getDataType(), TDengineTableField.TYPE_NCHAR)
.put(IotDataSpecsDataTypeEnum.DATE.getDataType(), TDengineTableField.TYPE_TIMESTAMP)
.put(IotDataSpecsDataTypeEnum.STRUCT.getDataType(), TDengineTableField.TYPE_NCHAR) // TODO 芋艿:怎么映射!!!!
.put(IotDataSpecsDataTypeEnum.ARRAY.getDataType(), TDengineTableField.TYPE_NCHAR) // TODO 芋艿:怎么映射!!!!
.put(IotDataSpecsDataTypeEnum.STRUCT.getDataType(), TDengineTableField.TYPE_NCHAR) // TODO ZT:怎么映射!!!!
.put(IotDataSpecsDataTypeEnum.ARRAY.getDataType(), TDengineTableField.TYPE_NCHAR) // TODO ZT:怎么映射!!!!
.build();
@Resource
@@ -133,7 +133,7 @@ public class IotDevicePropertyServiceImpl implements IotDevicePropertyService {
}
// 2. 根据物模型,拼接合法的属性
// TODO @芋艿:【待定 004】赋能后属性到底以 thingModel 为准ik还是 db 的表结构为准tl
// TODO @ZT:【待定 004】赋能后属性到底以 thingModel 为准ik还是 db 的表结构为准tl
List<IotThingModelDO> thingModels = thingModelService.getThingModelListByProductKeyFromCache(device.getProductKey());
Map<String, Object> properties = new HashMap<>();
((Map<?, ?>) message.getData()).forEach((key, value) -> {

View File

@@ -46,7 +46,7 @@ public class IotOtaFirmwareServiceImpl implements IotOtaFirmwareService {
// TODO @liproductService.getProduct(Convert.toLong(firmware.getProductId())) 放到 1. 后面先做参考校验。逻辑两段1先参数校验2构建对象 + 存储
IotProductDO product = productService.getProduct(Convert.toLong(firmware.getProductId()));
firmware.setProductKey(Objects.requireNonNull(product).getProductKey());
// TODO @芋艿: 附件、附件签名等属性的计算
// TODO @ZT: 附件、附件签名等属性的计算
otaFirmwareMapper.insert(firmware);
return firmware.getId();
}

View File

@@ -69,7 +69,7 @@ public class IotOtaUpgradeRecordServiceImpl implements IotOtaUpgradeRecordServic
}).toList();
// 3.保存数据
upgradeRecordMapper.insertBatch(upgradeRecordList);
// TODO @芋艿:在这里需要处理推送升级任务的逻辑
// TODO @ZT:在这里需要处理推送升级任务的逻辑
}
@@ -140,7 +140,7 @@ public class IotOtaUpgradeRecordServiceImpl implements IotOtaUpgradeRecordServic
@Override
public void cancelUpgradeRecordByTaskId(Long taskId) {
// 暂定只有待推送的升级记录可以取消 TODO @芋艿:可以看看阿里云,哪些可以取消
// 暂定只有待推送的升级记录可以取消 TODO @ZT:可以看看阿里云,哪些可以取消
upgradeRecordMapper.updateUpgradeRecordStatusByTaskIdAndStatus(
IotOtaUpgradeRecordStatusEnum.CANCELED.getStatus(), taskId,
IotOtaUpgradeRecordStatusEnum.PENDING.getStatus());

View File

@@ -123,7 +123,7 @@ public class IotProductServiceImpl implements IotProductService {
validateProductExists(id);
// 2. 更新为发布状态,需要创建产品超级表数据模型
// TODO @芋艿:【待定 001】1是否需要操作后在 redis 进行缓存,实现一个“快照”的情况,类似 tl
// TODO @ZT:【待定 001】1是否需要操作后在 redis 进行缓存,实现一个“快照”的情况,类似 tl
if (Objects.equals(status, IotProductStatusEnum.PUBLISHED.getStatus())) {
devicePropertyDataService.defineDevicePropertyData(id);
}

View File

@@ -37,7 +37,7 @@ public interface IotRuleSceneService {
void executeRuleSceneByTimer(Long id);
/**
* TODO 芋艿:测试方法,需要删除
* TODO ZT:测试方法,需要删除
*/
void test();

View File

@@ -61,7 +61,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
@Resource(name = "iotSchedulerManager")
private IotSchedulerManager schedulerManager;
// TODO 芋艿,缓存待实现
// TODO ZT,缓存待实现
@Override
@TenantIgnore // 忽略租户隔离:因为 IotRuleSceneMessageHandler 调用时,一般未传递租户,所以需要忽略
public List<IotRuleSceneDO> getRuleSceneListByProductKeyAndDeviceNameFromCache(String productKey, String deviceName) {
@@ -164,7 +164,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
.put("color", "red")
.build());
action01.setDeviceControl(actionDeviceControl01);
// ruleScene01.getActions().add(action01); // TODO 芋艿:先不测试了
// ruleScene01.getActions().add(action01); // TODO ZT:先不测试了
// 数据桥接http
IotRuleSceneDO.ActionConfig action02 = new IotRuleSceneDO.ActionConfig();
action02.setType(IotRuleSceneActionTypeEnum.DATA_BRIDGE.getType());
@@ -174,7 +174,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
}
List<IotRuleSceneDO> list = ruleSceneMapper.selectList();
// TODO @芋艿:需要考虑开启状态
// TODO @ZT:需要考虑开启状态
return filterList(list, ruleScene -> {
for (IotRuleSceneDO.TriggerConfig trigger : ruleScene.getTriggers()) {
if (ObjUtil.notEqual(trigger.getProductKey(), productKey)) {
@@ -207,7 +207,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
public void executeRuleSceneByTimer(Long id) {
// 1.1 获得规则场景
// IotRuleSceneDO scene = TenantUtils.executeIgnore(() -> ruleSceneMapper.selectById(id));
// TODO @芋艿:这里,临时测试,后续删除。
// TODO @ZT:这里,临时测试,后续删除。
IotRuleSceneDO scene = new IotRuleSceneDO().setStatus(CommonStatusEnum.ENABLE.getStatus());
if (true) {
scene.setTenantId(1L);
@@ -258,7 +258,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
*/
private List<IotRuleSceneDO> getMatchedRuleSceneListByMessage(IotDeviceMessage message) {
// 1. 匹配设备
// TODO @芋艿:可能需要 getSelf(); 缓存
// TODO @ZT:可能需要 getSelf(); 缓存
List<IotRuleSceneDO> ruleScenes = getRuleSceneListByProductKeyAndDeviceNameFromCache(
message.getProductKey(), message.getDeviceName());
if (CollUtil.isEmpty(ruleScenes)) {
@@ -272,7 +272,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
if (ObjUtil.notEqual(trigger.getType(), IotRuleSceneTriggerTypeEnum.DEVICE.getType())) {
return false;
}
// TODO 芋艿:产品、设备的匹配,要不要这里在做一次???貌似和 1. 部分重复了
// TODO ZT:产品、设备的匹配,要不要这里在做一次???貌似和 1. 部分重复了
// 2.2 条件为空,说明没有匹配的条件,因此不匹配
if (CollUtil.isEmpty(trigger.getConditions())) {
return false;
@@ -298,7 +298,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
});
}
// TODO @芋艿:【可优化】可以考虑增加下单测,边界太多了。
// TODO @ZT:【可优化】可以考虑增加下单测,边界太多了。
/**
* 判断触发器的条件参数是否匹配
*
@@ -392,7 +392,7 @@ public class IotRuleSceneServiceImpl implements IotRuleSceneService {
@Override
@SneakyThrows
public void test() {
// TODO @芋艿:测试思路代码,记得删除!!!
// TODO @ZT:测试思路代码,记得删除!!!
// 1. Job 类IotRuleSceneJob DONE
// 2. 参数id DONE
// 3. jobHandlerNameIotRuleSceneJob + id DONE

View File

@@ -13,7 +13,7 @@ import javax.annotation.Nullable;
*/
public interface IotRuleSceneAction {
// TODO @芋艿groovy 或者 javascript 实现数据的转换;可以考虑基于 hutool 的 ScriptUtil 做
// TODO @ZTgroovy 或者 javascript 实现数据的转换;可以考虑基于 hutool 的 ScriptUtil 做
/**
* 执行场景
*

View File

@@ -17,7 +17,7 @@ public class IotRuleSceneAlertAction implements IotRuleSceneAction {
@Override
public void execute(@Nullable IotDeviceMessage message, IotRuleSceneDO.ActionConfig config) {
// TODO @芋艿:待实现
// TODO @ZT:待实现
}
@Override

View File

@@ -11,10 +11,10 @@ import lombok.extern.slf4j.Slf4j;
import java.time.Duration;
// TODO @芋艿:数据库
// TODO @芋艿mqtt
// TODO @芋艿tcp
// TODO @芋艿websocket
// TODO @ZT:数据库
// TODO @ZTmqtt
// TODO @ZTtcp
// TODO @ZTwebsocket
/**
* 带缓存功能的数据桥梁执行器抽象类

View File

@@ -126,7 +126,7 @@ logging:
file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
--- #################### iot相关配置 TODO 芋艿【IOT】再瞅瞅 ####################
--- #################### iot相关配置 TODO ZT【IOT】再瞅瞅 ####################
pf4j:
# pluginsDir: /tmp/
pluginsDir: ../plugins

View File

@@ -136,9 +136,9 @@ logging:
# 配置自己写的 MyBatis Mapper 打印日志
com.zt.plat.module.iot.dal.mysql: debug
com.zt.plat.module.iot.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO ZT先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
--- #################### iot相关配置 TODO 芋艿【IOT】再瞅瞅 ####################
--- #################### iot相关配置 TODO ZT【IOT】再瞅瞅 ####################
pf4j:
# pluginsDir: /tmp/
pluginsDir: ../plugins

View File

@@ -54,7 +54,7 @@ springdoc:
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
knife4j:
enable: false # TODO 芋艿需要关闭增强具体原因见https://github.com/xiaoymin/knife4j/issues/874
enable: false # TODO ZT需要关闭增强具体原因见https://github.com/xiaoymin/knife4j/issues/874
setting:
language: zh_cn
@@ -126,7 +126,7 @@ xxl:
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
accessToken: default_token # 执行器通讯TOKEN
--- #################### 芋道相关配置 ####################
--- #################### ZT相关配置 ####################
zt:
info:
@@ -152,6 +152,6 @@ zt:
- iot:thing_model_list
debug: false
# 插件配置 TODO 芋艿【IOT】需要处理下
# 插件配置 TODO ZT【IOT】需要处理下
pf4j:
pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录

View File

@@ -13,7 +13,7 @@
<name>${project.artifactId}</name>
<description>
<!-- TODO @芋艿:注释 -->
<!-- TODO @ZT:注释 -->
物联网 插件 模块 - 通用功能
</description>

View File

@@ -19,7 +19,7 @@ import static com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConsta
/**
* IoT 设备配置设置 Vertx Handler
*
* 芋道源码
* ZT源码
*/
@Slf4j
@RequiredArgsConstructor

View File

@@ -17,7 +17,7 @@ import static com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConsta
/**
* IoT 设备 OTA 升级 Vertx Handler
* <p>
* 芋道源码
* ZT源码
*/
@Slf4j
@RequiredArgsConstructor

View File

@@ -19,7 +19,7 @@ import static com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConsta
/**
* IoT 设备服务获取 Vertx Handler
*
* 芋道源码
* ZT源码
*/
@Slf4j
@RequiredArgsConstructor

View File

@@ -19,7 +19,7 @@ import static com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConsta
/**
* IoT 设置设备属性 Vertx Handler
*
* 芋道源码
* ZT源码
*/
@Slf4j
@RequiredArgsConstructor

View File

@@ -19,7 +19,7 @@ import static com.zt.plat.framework.common.exception.enums.GlobalErrorCodeConsta
/**
* IoT 设备服务调用 Vertx Handler
*
* 芋道源码
* ZT源码
*/
@Slf4j
@RequiredArgsConstructor

View File

@@ -1,2 +1,2 @@
// TODO @芋艿:注释
// TODO @ZT:注释
package com.zt.plat.module.iot.plugin.common;

View File

@@ -2,7 +2,7 @@ package com.zt.plat.module.iot.plugin.common.pojo;
import lombok.Data;
// TODO @芋艿1后续考虑要不要叫 IoT 网关之类的 Response2包名 pojo
// TODO @ZT1后续考虑要不要叫 IoT 网关之类的 Response2包名 pojo
/**
* IoT 标准协议响应实体类
* <p>

View File

@@ -39,19 +39,19 @@ public class IotDeviceUpstreamClient implements IotDeviceUpstreamApi {
return doPost(url, reportReqDTO);
}
// TODO @芋艿:待实现
// TODO @ZT:待实现
@Override
public CommonResult<Boolean> registerDevice(IotDeviceRegisterReqDTO registerReqDTO) {
return null;
}
// TODO @芋艿:待实现
// TODO @ZT:待实现
@Override
public CommonResult<Boolean> registerSubDevice(IotDeviceRegisterSubReqDTO registerReqDTO) {
return null;
}
// TODO @芋艿:待实现
// TODO @ZT:待实现
@Override
public CommonResult<Boolean> addDeviceTopology(IotDeviceTopologyAddReqDTO addReqDTO) {
return null;

View File

@@ -15,7 +15,7 @@
<version>1.0.0</version>
<name>${project.artifactId}</name>
<!-- TODO @芋艿:待整理 -->
<!-- TODO @ZT:待整理 -->
<description>
物联网 插件模块 - emqx 插件
</description>

View File

@@ -50,7 +50,7 @@ public class IotEmqxPlugin extends SpringPlugin {
// 继续使用插件自己的 ClassLoader 以加载插件内部的类
pluginContext.setClassLoader(getWrapper().getPluginClassLoader());
// 扫描当前插件的自动配置包
// TODO @芋艿:是不是要配置下包
// TODO @ZT:是不是要配置下包
pluginContext.scan("com.zt.plat.module.iot.plugin.emqx.config");
pluginContext.refresh();
return pluginContext;

View File

@@ -108,7 +108,7 @@ public class IotDeviceUpstreamServer {
// 3. 等待所有服务启动完成
CompletableFuture.allOf(httpFuture, mqttFuture)
.orTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS) // TODO @芋艿JDK8 不兼容
.orTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS) // TODO @ZTJDK8 不兼容
.whenComplete((result, error) -> {
if (error != null) {
log.error("[start][服务启动失败]", error);

View File

@@ -16,7 +16,7 @@
<name>${project.artifactId}</name>
<description>
<!-- TODO @芋艿:注释 -->
<!-- TODO @ZT:注释 -->
物联网 插件模块 - http 插件
</description>

View File

@@ -8,7 +8,7 @@ import org.pf4j.spring.SpringPlugin;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
// TODO @芋艿:完善注释
// TODO @ZT:完善注释
/**
* 负责插件的启动和停止,与 Vert.x 的生命周期管理
*/
@@ -41,7 +41,7 @@ public class IotHttpVertxPlugin extends SpringPlugin {
}
}
// TODO @芋艿:思考下,未来要不要。。。
// TODO @ZT:思考下,未来要不要。。。
@Override
protected ApplicationContext createApplicationContext() {
// 创建插件自己的 ApplicationContext
@@ -51,7 +51,7 @@ public class IotHttpVertxPlugin extends SpringPlugin {
// 继续使用插件自己的 ClassLoader 以加载插件内部的类
pluginContext.setClassLoader(getWrapper().getPluginClassLoader());
// 扫描当前插件的自动配置包
// TODO @芋艿:后续看看,怎么配置类包
// TODO @ZT:后续看看,怎么配置类包
pluginContext.scan("com.zt.plat.module.iot.plugin.http.config");
pluginContext.refresh();
return pluginContext;

View File

@@ -14,7 +14,7 @@
<artifactId>zt-module-iot-plugin-mqtt</artifactId>
<name>${project.artifactId}</name>
<!-- TODO @芋艿:待整理 -->
<!-- TODO @ZT:待整理 -->
<description>
物联网 插件模块 - mqtt 插件
</description>

View File

@@ -4,7 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;
// TODO @芋艿:暂未实现
// TODO @ZT:暂未实现
@Slf4j
public class MqttPlugin extends Plugin {

View File

@@ -21,7 +21,7 @@ import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
// TODO @芋艿:暂未实现
// TODO @ZT:暂未实现
/**
* 根据官方示例,整合常见 MQTT 功能到 PF4J 的 Extension 类中
*/