فهرست منبع

add 添加子设备消息类型

18339543638 4 سال پیش
والد
کامیت
a3a1a7a239

+ 4 - 0
jetlinks-components/common-component/src/main/java/org/jetlinks/community/annotation/MessageValueCodec.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import lombok.Data;
 import org.hswebframework.ezorm.core.ValueCodec;
+import org.jetlinks.core.message.ChildDeviceMessage;
 import org.jetlinks.core.message.MessageType;
 import org.jetlinks.core.message.function.FunctionInvokeMessage;
 import org.jetlinks.core.message.property.ReadPropertyMessage;
@@ -36,6 +37,9 @@ public class MessageValueCodec implements ValueCodec<Object, Object> {
         if(MessageType.INVOKE_FUNCTION.name().equals(msgType)){
             return jsonObject.toJavaObject(FunctionInvokeMessage.class);
         }
+        if(MessageType.CHILD.name().equals(msgType)){
+            return jsonObject.toJavaObject(ChildDeviceMessage.class);
+        }
         return null;
     }
 }

+ 0 - 1
jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/interceptor/DeviceDirectiveSendInterceptor.java

@@ -73,7 +73,6 @@ public class DeviceDirectiveSendInterceptor implements DeviceMessageSenderInterc
 //                    .where(DeviceDirectivesEntity::getDeviceId,message.getDeviceId())
                     .where(DeviceDirectivesEntity::getMessageId,message.getMessageId())
                     .set(DeviceDirectivesEntity::getLastError,e.getMessage())
-                    .set(DeviceDirectivesEntity::getDownstream,message)
                     .set(DeviceDirectivesEntity::getState,DirectiveState.sendError)
                     .execute())
                 .thenMany(reply);