liuxiulin 8 tháng trước cách đây
mục cha
commit
3707aad4de
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      services/mqttaccess/mqtt_provider.go

+ 4 - 2
services/mqttaccess/mqtt_provider.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"context"
+	"fmt"
 	"github.com/gogf/gf/encoding/gjson"
 	"sparrow/pkg/klink"
 	"sparrow/pkg/models"
@@ -132,20 +133,21 @@ func (mp *MQTTProvider) OnDeviceMessage(deviceid, vendorId string, msgtype strin
 }
 
 func processReportStatus(deviceid, vendorId string, message *gjson.Json) {
-
+	fmt.Printf("deviceId-------------------:%v", deviceid)
 	device := &models.Device{}
 	err := server.RPCCallByName(nil, rpcs.RegistryServerName, "Registry.FindDeviceByIdentifier", deviceid, device)
 	if err != nil {
 		server.Log.Errorf("device not found %s", deviceid)
 		return
 	}
+	fmt.Printf("device-------------------:%v", device)
 	product := &models.Product{}
 	err = server.RPCCallByName(nil, rpcs.RegistryServerName, "Registry.FindProduct", device.ProductID, product)
 	if err != nil {
 		server.Log.Errorf("find product error : %v", err)
 		return
 	}
-
+	fmt.Printf("product-------------------:%v", product)
 	reply := rpcs.ReplyOnStatus{}
 	args := rpcs.ArgsOnStatus{
 		DeviceId:    deviceid,