Browse Source

设备列表返回设备状态异常

baozhensong 6 years ago
parent
commit
afff977eb0
2 changed files with 5 additions and 7 deletions
  1. 2 4
      services/knowoapi/controllers/device.go
  2. 3 3
      services/knowoapi/services/device.go

+ 2 - 4
services/knowoapi/controllers/device.go

@@ -61,9 +61,7 @@ func (a *DeviceController) GetDevicecount() {
 		return
 	}
 
-	done(a.Ctx, map[string]interface{}{
-		"data": data,
-	})
+	done(a.Ctx, data)
 }
 
 //获取设备在线状态
@@ -94,7 +92,7 @@ func (a *DeviceController) GetDevicestatus() {
 	}
 
 	done(a.Ctx, map[string]interface{}{
-		"status": status,
+		"Status": status,
 	})
 
 }

+ 3 - 3
services/knowoapi/services/device.go

@@ -117,9 +117,9 @@ func (a deviceservice) GetDevicesCountByVenderId(vendorid uint) (map[string]inte
 	}
 
 	deviceCount := map[string]interface{}{
-		"totaldata":    len(data),
-		"onlineCount":  onlineCount,
-		"offlineCount": offlineCount,
+		"TotalData":    len(data),
+		"OnlineCount":  onlineCount,
+		"OfflineCount": offlineCount,
 	}
 
 	return deviceCount, nil