优化产品ID处理
This commit is contained in:
parent
66a09c951c
commit
67c5e2c884
|
@ -85,9 +85,12 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
|
|||
if (convertResult == null) {
|
||||
return Mono.empty();
|
||||
}
|
||||
return context
|
||||
.getDevice()
|
||||
.getConfig(DeviceConfigKey.productId)
|
||||
return Mono
|
||||
.justOrEmpty(deviceMessage.getHeader("productId").map(String::valueOf))
|
||||
.switchIfEmpty(context.getDevice(deviceMessage.getDeviceId())
|
||||
.flatMap(device -> device
|
||||
.getConfig(DeviceConfigKey.productId))
|
||||
)
|
||||
.defaultIfEmpty("null")
|
||||
.map(productId -> SimpleMqttMessage
|
||||
.builder()
|
||||
|
|
Loading…
Reference in New Issue