From 29ca352766f848ac4dfe04c8eafba047e7d11280 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 25 May 2022 20:17:17 +0800 Subject: [PATCH] ingress --- test/mongo/mongo_utils.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/mongo/mongo_utils.go b/test/mongo/mongo_utils.go index 7053e56b6..591143d90 100644 --- a/test/mongo/mongo_utils.go +++ b/test/mongo/mongo_utils.go @@ -2,7 +2,6 @@ package mongo import ( "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db" server_api_params "Open_IM/pkg/proto/sdk_ws" "context" "fmt" @@ -16,10 +15,20 @@ var ( Client *mongo.Client ) +type MsgInfo struct { + SendTime int64 + Msg []byte +} + +type UserChat struct { + UID string + Msg []MsgInfo +} + func GetUserAllChat(uid string) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) collection := Client.Database(config.Config.Mongo.DBDatabase).Collection("msg") - var userChatList []db.UserChat + var userChatList []UserChat uid = uid + ":" filter := bson.M{"uid": bson.M{"$regex": uid}} //filter := bson.M{"uid": "17726378428:0"}