From 85b9a2cc3960e988c08f6e0d1afe068b1cc5f956 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 31 May 2022 14:22:42 +0800 Subject: [PATCH] redis replace go redis --- pkg/common/db/redisModel_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index c665ac884..a11f96bcd 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -1,8 +1,6 @@ package db import ( - pbChat "Open_IM/pkg/proto/chat" - "Open_IM/pkg/proto/sdk_ws" "context" "flag" "fmt" @@ -45,15 +43,17 @@ func Test_HGetAll(t *testing.T) { assert.Nil(t, err) fmt.Println(ttl) } + func Test_NewSetMessageToCache(t *testing.T) { - var msg pbChat.MsgDataToMQ - var data server_api_params.MsgData - uid := "test_uid" - data.Seq = 11 - data.ClientMsgID = "23jwhjsdf" - msg.MsgData = &data - messageList := []*pbChat.MsgDataToMQ{&msg} - err := DB.NewSetMessageToCache(messageList, uid, "cacheTest") + //var msg pbChat.MsgDataToMQ + //var data server_api_params.MsgData + //uid := "test_uid" + //data.Seq = 11 + //data.ClientMsgID = "23jwhjsdf" + //msg.MsgData = &data + //messageList := []*pbChat.MsgDataToMQ{&msg} + //err := DB.NewSetMessageToCache(messageList, uid, "cacheTest") + err := DB.rdb.HMSet(context.Background(), "12", map[string]interface{}{"1": 2}).Err() assert.Nil(t, err) }