|
|
@@ -2,7 +2,9 @@ package scene
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "fmt"
|
|
|
"github.com/gogf/gf/database/gredis"
|
|
|
+ "github.com/gogf/gf/encoding/gjson"
|
|
|
)
|
|
|
|
|
|
const (
|
|
|
@@ -144,7 +146,7 @@ func (a *Manager) GetAllScenesPage(code string, pi, ps int) (AllSceneResult, err
|
|
|
if err != nil {
|
|
|
return result, err
|
|
|
}
|
|
|
-
|
|
|
+ fmt.Printf("keys---------------:%s", keys)
|
|
|
// 检查是否有数据
|
|
|
if keys.IsEmpty() {
|
|
|
return result, nil
|
|
|
@@ -161,9 +163,8 @@ func (a *Manager) GetAllScenesPage(code string, pi, ps int) (AllSceneResult, err
|
|
|
end = len(keyList) - 1
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ fmt.Printf("start:%d,end:%d", start, end)
|
|
|
// 存储所有结果
|
|
|
- scenes := make([]*InfoScene, 0)
|
|
|
var scene InfoScene
|
|
|
for i := start; i <= end; i++ {
|
|
|
r, err := a.redisClient.DoVar("GET", keyList[i])
|
|
|
@@ -174,7 +175,8 @@ func (a *Manager) GetAllScenesPage(code string, pi, ps int) (AllSceneResult, err
|
|
|
if err != nil {
|
|
|
return result, err
|
|
|
}
|
|
|
- scenes = append(scenes, &scene)
|
|
|
+ fmt.Printf("scene:%s", gjson.New(scene).MustToJsonString())
|
|
|
+ result.Data = append(result.Data, &scene)
|
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
@@ -198,7 +200,6 @@ func (a *Manager) GetAllScenes(code string) ([]*InfoScene, error) {
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
-
|
|
|
// 检查是否有数据
|
|
|
if keys.IsEmpty() {
|
|
|
return nil, nil
|