From bc0b7e914a378b2c40f9d2ec2470b61a19c18288 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 11 八月 2023 17:05:02 +0800
Subject: [PATCH] 修改上报的数据结构, 添加plc查询接口

---
 msg/send.go |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/msg/send.go b/msg/send.go
index 3e2d822..8290dda 100644
--- a/msg/send.go
+++ b/msg/send.go
@@ -2,12 +2,12 @@
 
 import (
 	"encoding/json"
-	"plc-recorder/util"
 	"time"
 
 	"plc-recorder/config"
 	"plc-recorder/logger"
 	"plc-recorder/nsqclient"
+	"plc-recorder/util"
 )
 
 func SendDeviceLiveData(response *PLCResponse) {
@@ -19,7 +19,8 @@
 
 	// aps 鍙戝竷
 	if config.Options.PostPLCDataWebApi != "" {
-		_, err := util.HttpPost(config.Options.PostPLCDataWebApi, b)
+		token, _ := util.CreateToken()
+		_, err := util.HttpPost(config.Options.PostPLCDataWebApi, b, token)
 		if err != nil {
 			logger.Warn(err.Error())
 		}
@@ -36,7 +37,6 @@
 			DeviceName: "test",
 			DeviceIP:   "0.0.0.0",
 			Online:     true,
-			Message:    "",
 			PLCData: []PLCData{{
 				StartAddress: 100,
 				Length:       1,

--
Gitblit v1.8.0