feat(iot): 设备事件增加 nickname 字段

在 BaseDeviceEvent 中新增 nickname 字段,用于存储设备的用户可读显示名称(如"张三的工牌"),
IotDeviceServiceImpl 在发送设备状态变更事件时自动填充该字段。

变更范围:
- BaseDeviceEvent: 新增 nickname 字段
- IotDeviceServiceImpl: 事件发送时携带 nickname

影响模块:IoT Core、IoT Server

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
lzh
2026-02-02 22:26:37 +08:00
parent 46096a6e6b
commit b4fad17254
2 changed files with 8 additions and 2 deletions

View File

@@ -343,6 +343,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
DeviceStatusChangedEvent event = DeviceStatusChangedEvent.builder()
.deviceId(device.getId())
.deviceName(device.getDeviceName())
.nickname(device.getNickname())
.productId(device.getProductId())
.productKey(productKey)
.tenantId(device.getTenantId())