|
|
|
@ -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", |
|
|
|
|