Browse Source

平台的规则更新了:

1是在线并且开启
2是在线且关闭状态
3是离线
进程获取到了设备的状态都是2,但是隆江那边1-在线、2-离线、3-无法确定
dev
18209 2 weeks ago
parent
commit
bb9183f92e
  1. 6
      consumers/consumerESraw2http.go

6
consumers/consumerESraw2http.go

@ -99,12 +99,16 @@ func SendPostRequest(url string, postThings models.PostThings) error {
formattedTime := time.Now().Format("2006-01-02 15:04:05")
// 构建请求体
onlineValue := 1
if postThings.Online == 3 {
onlineValue = 2
}
postBody := map[string]interface{}{
"equipcode": postThings.EquipCode,
"lng": postThings.Lng,
"lat": postThings.Lat,
"status": 1,
"online": postThings.Online,
"online": onlineValue,
"currentstate": 1,
"led": 1,
"startorstopstate": "Start",

Loading…
Cancel
Save