【代码评审】IoT:增加相关待定项

This commit is contained in:
YunaiV 2025-02-12 18:19:53 +08:00
parent d116e5eec1
commit c27b02beb6
3 changed files with 6 additions and 3 deletions

View File

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

View File

@ -32,6 +32,7 @@ public interface IotDevicePropertyMapper {
default void alterProductPropertySTable(String productKey,
List<TDengineTableField> oldFields,
List<TDengineTableField> newFields) {
// TODO @芋艿需要处理 device_key重新发布的时候
oldFields.removeIf(field -> StrUtil.equalsAny(field.getField(),
TDengineTableField.FIELD_TS, "report_time"));
List<TDengineTableField> addFields = newFields.stream().filter( // 新增的字段
@ -51,7 +52,7 @@ public interface IotDevicePropertyMapper {
modifyTypeFields.add(newField);
return;
}
if (newField.getLength()!= null) {
if (newField.getLength() != null) {
if (newField.getLength() > oldField.getLength()) {
modifyLengthFields.add(newField);
} else if (newField.getLength() < oldField.getLength()) {

View File

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