Commit 5efb57838553737df2cba59c894ff333eafb8c3a

Authored by YunaiV
1 parent f64d84bb

feat(iot): 为所有消息方法补齐 Topic DTO,消除通用 Map

1. 新增 3 个 DTO:
   - IotDevicePropertySetReqDTO:属性设置(下行)
   - IotDeviceServiceInvokeReqDTO:服务调用(下行)
   - IotDeviceConfigPushReqDTO:配置推送(下行)
2. 所有现有 DTO 的 javadoc 补充 {@link IotDeviceMessageMethodEnum#XXX} 引用
Showing 15 changed files with 34 additions and 16 deletions
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/auth/IotDeviceRegisterReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.auth;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import jakarta.validation.constraints.NotEmpty;
4 5 import lombok.Data;
5 6  
6 7 /**
7 8 * IoT 设备动态注册 Request DTO
8 9 * <p>
9   - * 用于直连设备/网关的一型一密动态注册:使用 productSecret 验证,返回 deviceSecret
  10 + * 用于 {@link IotDeviceMessageMethodEnum#DEVICE_REGISTER} 消息的 params 参数
  11 + * <p>
  12 + * 直连设备/网关的一型一密动态注册:使用 productSecret 验证,返回 deviceSecret
10 13 *
11 14 * @author 芋道源码
12 15 * @see <a href="https://help.aliyun.com/zh/iot/user-guide/unique-certificate-per-product-verification">阿里云 - 一型一密</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/auth/IotDeviceRegisterRespDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.auth;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.AllArgsConstructor;
4 5 import lombok.Data;
5 6 import lombok.NoArgsConstructor;
... ... @@ -7,7 +8,7 @@ import lombok.NoArgsConstructor;
7 8 /**
8 9 * IoT 设备动态注册 Response DTO
9 10 * <p>
10   - * 用于直连设备/网关的一型一密动态注册响应
  11 + * 用于 {@link IotDeviceMessageMethodEnum#DEVICE_REGISTER} 响应的设备信息
11 12 *
12 13 * @author 芋道源码
13 14 * @see <a href="https://help.aliyun.com/zh/iot/user-guide/unique-certificate-per-product-verification">阿里云 - 一型一密</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/auth/IotSubDeviceRegisterReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.auth;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import jakarta.validation.constraints.NotEmpty;
4 5 import lombok.Data;
5 6  
6 7 /**
7 8 * IoT 子设备动态注册 Request DTO
8 9 * <p>
9   - * 用于 thing.auth.register.sub 消息的 params 数组元素
10   - *
  10 + * 用于 {@link IotDeviceMessageMethodEnum#SUB_DEVICE_REGISTER} 消息的 params 数组元素
  11 + * <p>
11 12 * 特殊:网关子设备的动态注册,必须已经创建好该网关子设备(不然哪来的 {@link #deviceName} 字段)。更多的好处,是设备不用提前烧录 deviceSecret 密钥。
12 13 *
13 14 * @author 芋道源码
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/auth/IotSubDeviceRegisterRespDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.auth;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.AllArgsConstructor;
4 5 import lombok.Data;
5 6 import lombok.NoArgsConstructor;
... ... @@ -7,7 +8,7 @@ import lombok.NoArgsConstructor;
7 8 /**
8 9 * IoT 子设备动态注册 Response DTO
9 10 * <p>
10   - * 用于 thing.auth.register.sub 响应的设备信息
  11 + * 用于 {@link IotDeviceMessageMethodEnum#SUB_DEVICE_REGISTER} 响应的设备信息
11 12 *
12 13 * @author 芋道源码
13 14 * @see <a href="https://help.aliyun.com/zh/iot/user-guide/register-devices">阿里云 - 动态注册子设备</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/event/IotDeviceEventPostReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.event;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.Data;
4 5  
5 6 /**
6 7 * IoT 设备事件上报 Request DTO
7 8 * <p>
8   - * 用于 thing.event.post 消息的 params 参数
  9 + * 用于 {@link IotDeviceMessageMethodEnum#EVENT_POST} 消息的 params 参数
9 10 *
10 11 * @author 芋道源码
11 12 * @see <a href="http://help.aliyun.com/zh/marketplace/device-reporting-events">阿里云 - 设备上报事件</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/ota/IotDeviceOtaProgressReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.ota;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.AllArgsConstructor;
4 5 import lombok.Data;
5 6 import lombok.NoArgsConstructor;
... ... @@ -7,7 +8,7 @@ import lombok.NoArgsConstructor;
7 8 /**
8 9 * IoT 设备 OTA 升级进度上报 Request DTO
9 10 * <p>
10   - * 用于 thing.ota.progress 上行消息的 params 参数
  11 + * 用于 {@link IotDeviceMessageMethodEnum#OTA_PROGRESS} 上行消息的 params 参数
11 12 *
12 13 * @author 芋道源码
13 14 * @see <a href="https://help.aliyun.com/zh/iot/user-guide/perform-ota-updates">阿里云 - OTA 升级</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/ota/IotDeviceOtaUpgradeReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.ota;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.AllArgsConstructor;
4 5 import lombok.Data;
5 6 import lombok.NoArgsConstructor;
... ... @@ -7,7 +8,7 @@ import lombok.NoArgsConstructor;
7 8 /**
8 9 * IoT 设备 OTA 固件升级推送 Request DTO
9 10 * <p>
10   - * 用于 thing.ota.upgrade 下行消息的 params 参数
  11 + * 用于 {@link IotDeviceMessageMethodEnum#OTA_UPGRADE} 下行消息的 params 参数
11 12 *
12 13 * @author 芋道源码
13 14 * @see <a href="https://help.aliyun.com/zh/iot/user-guide/perform-ota-updates">阿里云 - OTA 升级</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/property/IotDevicePropertyPackPostReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.property;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import cn.iocoder.yudao.module.iot.core.topic.IotDeviceIdentity;
4 5 import lombok.Data;
5 6  
... ... @@ -9,7 +10,7 @@ import java.util.Map;
9 10 /**
10 11 * IoT 设备属性批量上报 Request DTO
11 12 * <p>
12   - * 用于 thing.event.property.pack.post 消息的 params 参数
  13 + * 用于 {@link IotDeviceMessageMethodEnum#PROPERTY_PACK_POST} 消息的 params 参数
13 14 *
14 15 * @author 芋道源码
15 16 * @see <a href="http://help.aliyun.com/zh/marketplace/gateway-reports-data-in-batches">阿里云 - 网关批量上报数据</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/property/IotDevicePropertyPostReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.property;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
  4 +
3 5 import java.util.HashMap;
4 6 import java.util.Map;
5 7  
6 8 /**
7 9 * IoT 设备属性上报 Request DTO
8 10 * <p>
9   - * 用于 thing.property.post 消息的 params 参数
  11 + * 用于 {@link IotDeviceMessageMethodEnum#PROPERTY_POST} 消息的 params 参数
10 12 * <p>
11 13 * 本质是一个 Map,key 为属性标识符,value 为属性值
12 14 *
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/state/IotDeviceStateUpdateReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.state;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.AllArgsConstructor;
4 5 import lombok.Data;
5 6 import lombok.NoArgsConstructor;
... ... @@ -7,7 +8,7 @@ import lombok.NoArgsConstructor;
7 8 /**
8 9 * IoT 设备状态更新 Request DTO
9 10 * <p>
10   - * 用于 thing.state.update 消息的 params 参数
  11 + * 用于 {@link IotDeviceMessageMethodEnum#STATE_UPDATE} 消息的 params 参数
11 12 *
12 13 * @author 芋道源码
13 14 */
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/topo/IotDeviceTopoAddReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.topo;
2 2  
3 3 import cn.iocoder.yudao.module.iot.core.biz.dto.IotDeviceAuthReqDTO;
  4 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
4 5 import jakarta.validation.constraints.NotEmpty;
5 6 import lombok.Data;
6 7  
... ... @@ -9,7 +10,7 @@ import java.util.List;
9 10 /**
10 11 * IoT 设备拓扑添加 Request DTO
11 12 * <p>
12   - * 用于 thing.topo.add 消息的 params 参数
  13 + * 用于 {@link IotDeviceMessageMethodEnum#TOPO_ADD} 消息的 params 参数
13 14 *
14 15 * @author 芋道源码
15 16 * @see <a href="http://help.aliyun.com/zh/marketplace/add-topological-relationship">阿里云 - 添加拓扑关系</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/topo/IotDeviceTopoChangeReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.topo;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import cn.iocoder.yudao.module.iot.core.topic.IotDeviceIdentity;
4 5 import lombok.AllArgsConstructor;
5 6 import lombok.Data;
... ... @@ -10,7 +11,7 @@ import java.util.List;
10 11 /**
11 12 * IoT 设备拓扑关系变更通知 Request DTO
12 13 * <p>
13   - * 用于 thing.topo.change 下行消息的 params 参数
  14 + * 用于 {@link IotDeviceMessageMethodEnum#TOPO_CHANGE} 下行消息的 params 参数
14 15 *
15 16 * @author 芋道源码
16 17 * @see <a href="https://help.aliyun.com/zh/marketplace/notify-gateway-topology-changes">阿里云 - 通知网关拓扑关系变化</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/topo/IotDeviceTopoDeleteReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.topo;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import cn.iocoder.yudao.module.iot.core.topic.IotDeviceIdentity;
4 5 import jakarta.validation.Valid;
5 6 import jakarta.validation.constraints.NotEmpty;
... ... @@ -10,7 +11,7 @@ import java.util.List;
10 11 /**
11 12 * IoT 设备拓扑删除 Request DTO
12 13 * <p>
13   - * 用于 thing.topo.delete 消息的 params 参数
  14 + * 用于 {@link IotDeviceMessageMethodEnum#TOPO_DELETE} 消息的 params 参数
14 15 *
15 16 * @author 芋道源码
16 17 * @see <a href="https://help.aliyun.com/zh/marketplace/delete-a-topological-relationship">阿里云 - 删除拓扑关系</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/topo/IotDeviceTopoGetReqDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.topo;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import lombok.Data;
4 5  
5 6 /**
6 7 * IoT 设备拓扑关系获取 Request DTO
7 8 * <p>
8   - * 用于 thing.topo.get 请求的 params 参数(目前为空,预留扩展)
  9 + * 用于 {@link IotDeviceMessageMethodEnum#TOPO_GET} 请求的 params 参数(目前为空,预留扩展)
9 10 *
10 11 * @author 芋道源码
11 12 * @see <a href="https://help.aliyun.com/zh/marketplace/obtain-topological-relationship">阿里云 - 获取拓扑关系</a>
... ...
yudao-module-iot/yudao-module-iot-core/src/main/java/cn/iocoder/yudao/module/iot/core/topic/topo/IotDeviceTopoGetRespDTO.java
1 1 package cn.iocoder.yudao.module.iot.core.topic.topo;
2 2  
  3 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
3 4 import cn.iocoder.yudao.module.iot.core.topic.IotDeviceIdentity;
4 5 import lombok.Data;
5 6  
... ... @@ -8,7 +9,7 @@ import java.util.List;
8 9 /**
9 10 * IoT 设备拓扑关系获取 Response DTO
10 11 * <p>
11   - * 用于 thing.topo.get 响应
  12 + * 用于 {@link IotDeviceMessageMethodEnum#TOPO_GET} 响应
12 13 *
13 14 * @author 芋道源码
14 15 * @see <a href="https://help.aliyun.com/zh/marketplace/obtain-topological-relationship">阿里云 - 获取拓扑关系</a>
... ...