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

1. 新增 3 个 DTO:
   - IotDevicePropertySetReqDTO:属性设置(下行)
   - IotDeviceServiceInvokeReqDTO:服务调用(下行)
   - IotDeviceConfigPushReqDTO:配置推送(下行)
2. 所有现有 DTO 的 javadoc 补充 {@link IotDeviceMessageMethodEnum#XXX} 引用
This commit is contained in:
YunaiV
2026-02-14 08:56:14 +08:00
parent 5efb578385
commit 5083dab10b
3 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
package cn.iocoder.yudao.module.iot.core.topic.config;
import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* IoT 设备配置推送 Request DTO
* <p>
* 用于 {@link IotDeviceMessageMethodEnum#CONFIG_PUSH} 下行消息的 params 参数
*
* @author 芋道源码
* @see <a href="https://help.aliyun.com/zh/iot/user-guide/remote-configuration-1">阿里云 - 远程配置</a>
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IotDeviceConfigPushReqDTO {
/**
* 配置编号
*/
private String configId;
/**
* 配置文件大小(字节)
*/
private Long configSize;
/**
* 签名方法
*/
private String signMethod;
/**
* 签名
*/
private String sign;
/**
* 配置文件下载地址
*/
private String url;
/**
* 获取类型
* <p>
* file: 文件
* content: 内容
*/
private String getType;
}

View File

@@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.iot.core.topic.property;
import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
import java.util.HashMap;
import java.util.Map;
/**
* IoT 设备属性设置 Request DTO
* <p>
* 用于 {@link IotDeviceMessageMethodEnum#PROPERTY_SET} 下行消息的 params 参数
* <p>
* 本质是一个 Mapkey 为属性标识符value 为属性值
*
* @author 芋道源码
*/
public class IotDevicePropertySetReqDTO extends HashMap<String, Object> {
public IotDevicePropertySetReqDTO() {
super();
}
public IotDevicePropertySetReqDTO(Map<String, Object> properties) {
super(properties);
}
/**
* 创建属性设置 DTO
*
* @param properties 属性数据
* @return DTO 对象
*/
public static IotDevicePropertySetReqDTO of(Map<String, Object> properties) {
return new IotDevicePropertySetReqDTO(properties);
}
}

View File

@@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.iot.core.topic.service;
import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* IoT 设备服务调用 Request DTO
* <p>
* 用于 {@link IotDeviceMessageMethodEnum#SERVICE_INVOKE} 下行消息的 params 参数
*
* @author 芋道源码
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IotDeviceServiceInvokeReqDTO {
/**
* 服务标识符
*/
private String identifier;
/**
* 服务输入参数
*/
private Map<String, Object> inputParams;
}