|
@@ -592,11 +592,14 @@ func WriteDataEmq(c *gin.Context) {
|
|
// @Success 200 {string} string "ok"
|
|
// @Success 200 {string} string "ok"
|
|
// @Router /v2/gateway/find [get]
|
|
// @Router /v2/gateway/find [get]
|
|
func FindGateway(c *gin.Context) {
|
|
func FindGateway(c *gin.Context) {
|
|
- marshal, err := json.Marshal(global.GatewayList)
|
|
|
|
- if err != nil {
|
|
|
|
- return
|
|
|
|
|
|
+
|
|
|
|
+ var gateways []gateway.GatewayInfo
|
|
|
|
+ if len(global.DeviceMap) > 0 {
|
|
|
|
+ for _, deviceInfo := range global.GatewayList {
|
|
|
|
+ gateways = append(gateways, deviceInfo)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- response.Success("查询网关设备完成", marshal, c)
|
|
|
|
|
|
+ response.Success("查询网关设备完成", gateways, c)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|