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