diff --git a/consumers/consumerESraw2http.go b/consumers/consumerESraw2http.go index b3e74b4..0314fd6 100644 --- a/consumers/consumerESraw2http.go +++ b/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,