|
|
@ -1,8 +1,6 @@
|
|
|
|
package db
|
|
|
|
package db
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
pbChat "Open_IM/pkg/proto/chat"
|
|
|
|
|
|
|
|
"Open_IM/pkg/proto/sdk_ws"
|
|
|
|
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"flag"
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
@ -45,15 +43,17 @@ func Test_HGetAll(t *testing.T) {
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
fmt.Println(ttl)
|
|
|
|
fmt.Println(ttl)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func Test_NewSetMessageToCache(t *testing.T) {
|
|
|
|
func Test_NewSetMessageToCache(t *testing.T) {
|
|
|
|
var msg pbChat.MsgDataToMQ
|
|
|
|
//var msg pbChat.MsgDataToMQ
|
|
|
|
var data server_api_params.MsgData
|
|
|
|
//var data server_api_params.MsgData
|
|
|
|
uid := "test_uid"
|
|
|
|
//uid := "test_uid"
|
|
|
|
data.Seq = 11
|
|
|
|
//data.Seq = 11
|
|
|
|
data.ClientMsgID = "23jwhjsdf"
|
|
|
|
//data.ClientMsgID = "23jwhjsdf"
|
|
|
|
msg.MsgData = &data
|
|
|
|
//msg.MsgData = &data
|
|
|
|
messageList := []*pbChat.MsgDataToMQ{&msg}
|
|
|
|
//messageList := []*pbChat.MsgDataToMQ{&msg}
|
|
|
|
err := DB.NewSetMessageToCache(messageList, uid, "cacheTest")
|
|
|
|
//err := DB.NewSetMessageToCache(messageList, uid, "cacheTest")
|
|
|
|
|
|
|
|
err := DB.rdb.HMSet(context.Background(), "12", map[string]interface{}{"1": 2}).Err()
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|