Browse Source

信号灯开启关闭

dev
18209 2 weeks ago
parent
commit
462278b702
  1. 7
      consumers/consumerESraw2http.go

7
consumers/consumerESraw2http.go

@ -100,8 +100,13 @@ func SendPostRequest(url string, postThings models.PostThings) error {
// 构建请求体
onlineValue := 1
startorstopstate := "start"
if postThings.Online == 3 {
onlineValue = 2
startorstopstate = "stop"
} else if postThings.Online == 2 {
startorstopstate = "stop"
onlineValue = 1
}
postBody := map[string]interface{}{
"equipcode": postThings.EquipCode,
@ -111,7 +116,7 @@ func SendPostRequest(url string, postThings models.PostThings) error {
"online": onlineValue,
"currentstate": 1,
"led": 1,
"startorstopstate": "Start",
"startorstopstate": startorstopstate,
"threshold": 10.0,
"thresholdchangerate": 10.0,
"updatetime": formattedTime,

Loading…
Cancel
Save