|
|
|
@ -39,76 +39,7 @@ func Test_msgCache_SetMessagesToCache(t *testing.T) {
|
|
|
|
|
wantErr assert.ErrorAssertionFunc
|
|
|
|
|
}{
|
|
|
|
|
{"test1", fields{rdb: redis.NewClient(&redis.Options{Addr: "localhost:16379", Username: "", Password: "openIM123", DB: 0})}, args{context.Background(),
|
|
|
|
|
"cid", []*sdkws.MsgData{{
|
|
|
|
|
SendID: "1",
|
|
|
|
|
RecvID: "2",
|
|
|
|
|
GroupID: "3",
|
|
|
|
|
ClientMsgID: "sdfsdf",
|
|
|
|
|
ServerMsgID: "234234",
|
|
|
|
|
SenderPlatformID: 0,
|
|
|
|
|
SenderNickname: "",
|
|
|
|
|
SenderFaceURL: "",
|
|
|
|
|
SessionType: 0,
|
|
|
|
|
MsgFrom: 0,
|
|
|
|
|
ContentType: 0,
|
|
|
|
|
Content: nil,
|
|
|
|
|
Seq: 1,
|
|
|
|
|
SendTime: 0,
|
|
|
|
|
CreateTime: 0,
|
|
|
|
|
Status: 0,
|
|
|
|
|
IsRead: false,
|
|
|
|
|
Options: nil,
|
|
|
|
|
OfflinePushInfo: nil,
|
|
|
|
|
AtUserIDList: nil,
|
|
|
|
|
AttachedInfo: "",
|
|
|
|
|
Ex: "",
|
|
|
|
|
}, {
|
|
|
|
|
SendID: "2",
|
|
|
|
|
RecvID: "3",
|
|
|
|
|
GroupID: "4",
|
|
|
|
|
ClientMsgID: "sdfsdfsd",
|
|
|
|
|
ServerMsgID: "sdfsdf",
|
|
|
|
|
SenderPlatformID: 0,
|
|
|
|
|
SenderNickname: "",
|
|
|
|
|
SenderFaceURL: "",
|
|
|
|
|
SessionType: 0,
|
|
|
|
|
MsgFrom: 0,
|
|
|
|
|
ContentType: 0,
|
|
|
|
|
Content: nil,
|
|
|
|
|
Seq: 2,
|
|
|
|
|
SendTime: 0,
|
|
|
|
|
CreateTime: 0,
|
|
|
|
|
Status: 0,
|
|
|
|
|
IsRead: false,
|
|
|
|
|
Options: nil,
|
|
|
|
|
OfflinePushInfo: nil,
|
|
|
|
|
AtUserIDList: nil,
|
|
|
|
|
AttachedInfo: "",
|
|
|
|
|
Ex: "",
|
|
|
|
|
}, {
|
|
|
|
|
SendID: "5",
|
|
|
|
|
RecvID: "6",
|
|
|
|
|
GroupID: "7",
|
|
|
|
|
ClientMsgID: "sdfd",
|
|
|
|
|
ServerMsgID: "sdfsdf",
|
|
|
|
|
SenderPlatformID: 0,
|
|
|
|
|
SenderNickname: "",
|
|
|
|
|
SenderFaceURL: "",
|
|
|
|
|
SessionType: 0,
|
|
|
|
|
MsgFrom: 0,
|
|
|
|
|
ContentType: 0,
|
|
|
|
|
Content: nil,
|
|
|
|
|
Seq: 3,
|
|
|
|
|
SendTime: 0,
|
|
|
|
|
CreateTime: 0,
|
|
|
|
|
Status: 0,
|
|
|
|
|
IsRead: false,
|
|
|
|
|
Options: nil,
|
|
|
|
|
OfflinePushInfo: nil,
|
|
|
|
|
AtUserIDList: nil,
|
|
|
|
|
AttachedInfo: "",
|
|
|
|
|
Ex: "",
|
|
|
|
|
}}}, 3, assert.NoError},
|
|
|
|
|
"cid", []*sdkws.MsgData{{Seq: 1}, {Seq: 2}, {Seq: 3}}}, 3, assert.NoError},
|
|
|
|
|
}
|
|
|
|
|
for _, tt := range tests {
|
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
|