【代码新增】IoT:实现 device 下行服务调用的逻辑

This commit is contained in:
YunaiV
2025-01-31 11:10:20 +08:00
parent 7670ac19e5
commit b454069897
17 changed files with 289 additions and 36 deletions

View File

@@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.iot.api.device.dto.control.downstream;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import java.util.Map;
/**
* IoT 设备【服务】调用 Request DTO
*
@@ -9,4 +12,15 @@ import lombok.Data;
*/
@Data
public class IotDeviceServiceInvokeReqDTO extends IotDeviceDownstreamAbstractReqDTO {
/**
* 服务标识
*/
@NotEmpty(message = "服务标识不能为空")
private String identifier;
/**
* 调用参数
*/
private Map<String, Object> params;
}

View File

@@ -19,7 +19,6 @@ public class IotDeviceEventReportReqDTO extends IotDeviceUpstreamAbstractReqDTO
/**
* 事件参数
*/
@NotEmpty(message = "事件参数不能为空")
private Map<String, Object> params;
}

View File

@@ -30,6 +30,7 @@ public interface ErrorCodeConstants {
ErrorCode DEVICE_GATEWAY_NOT_EXISTS = new ErrorCode(1_050_003_004, "网关设备不存在");
ErrorCode DEVICE_NOT_GATEWAY = new ErrorCode(1_050_003_005, "设备不是网关设备");
ErrorCode DEVICE_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_050_003_006, "导入设备数据不能为空!");
ErrorCode DEVICE_DOWNSTREAM_FAILED = new ErrorCode(1_050_003_007, "执行失败,原因:{}");
// ========== 产品分类 1-050-004-000 ==========
ErrorCode PRODUCT_CATEGORY_NOT_EXISTS = new ErrorCode(1_050_004_000, "产品分类不存在");
@@ -46,6 +47,6 @@ public interface ErrorCodeConstants {
ErrorCode PLUGIN_STATUS_INVALID = new ErrorCode(1_050_006_004, "插件状态无效");
// ========== 插件实例 1-050-007-000 ==========
ErrorCode PLUGIN_INSTANCE_NOT_EXISTS = new ErrorCode(1_050_007_000, "插件实例不存在");
}