|
|
@ -71,7 +71,7 @@ func (the Adaptor_AXY_LastRAW) raw2es(iotaData models.IotaData) *models.EsRaw { |
|
|
|
if iotaData.DeviceId == the.TagDeviceId { |
|
|
|
log.Printf("--> raw2es 标记设备[%s]数据 %v ", iotaData.DeviceId, iotaData.Data.Data) |
|
|
|
} |
|
|
|
EsRaws := toEsRaw(devdata) |
|
|
|
EsRaws := the.toEsRaw(devdata) |
|
|
|
return EsRaws |
|
|
|
} |
|
|
|
|
|
|
@ -138,7 +138,7 @@ func (the Adaptor_AXY_LastRAW) GetDeviceInfoFromRedis(deviceId string) (models.D |
|
|
|
}, nil |
|
|
|
} |
|
|
|
|
|
|
|
func toEsRaw(deviceData *models.DeviceData) *models.EsRaw { |
|
|
|
func (the Adaptor_AXY_LastRAW) toEsRaw(deviceData *models.DeviceData) *models.EsRaw { |
|
|
|
|
|
|
|
if deviceData == nil { |
|
|
|
return nil |
|
|
@ -154,6 +154,9 @@ func toEsRaw(deviceData *models.DeviceData) *models.EsRaw { |
|
|
|
IotaDevice: deviceData.DeviceId, |
|
|
|
CreateTime: time.Now(), |
|
|
|
} |
|
|
|
|
|
|
|
if createNativeRaw.IotaDevice == the.TagDeviceId { |
|
|
|
str, _ := json.Marshal(createNativeRaw) |
|
|
|
log.Printf("--> toEsRaw 标记设备[%s]数据 %s ", the.TagDeviceId, str) |
|
|
|
} |
|
|
|
return &createNativeRaw |
|
|
|
} |
|
|
|