|
@@ -1,9 +1,7 @@
|
|
|
package deviceStatus
|
|
|
|
|
|
import (
|
|
|
- "fmt"
|
|
|
"github.com/gogf/gf/database/gredis"
|
|
|
- "github.com/gogf/gf/encoding/gjson"
|
|
|
)
|
|
|
|
|
|
const (
|
|
@@ -43,15 +41,12 @@ func NewDevStatusManager(host string, port int) *DevStatusManager {
|
|
|
return mgr
|
|
|
}
|
|
|
|
|
|
-func (mgr *DevStatusManager) GetDeviceStatus(id string) (*gjson.Json, error) {
|
|
|
+func (mgr *DevStatusManager) GetDeviceStatus(id string) (string, error) {
|
|
|
key := KeyPrefix + id
|
|
|
- fmt.Println(key)
|
|
|
- var status SplitStatus
|
|
|
// get status from redis
|
|
|
result, err := mgr.redisClient.DoVar("GET", key)
|
|
|
if err != nil {
|
|
|
- return nil, err
|
|
|
+ return "", err
|
|
|
}
|
|
|
- err = result.Struct(&status)
|
|
|
- return gjson.New(result.String()), nil
|
|
|
+ return result.String(), nil
|
|
|
}
|