mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-18 20:19:14 +08:00
Updated pkg/common/db/controller/msg.go
This commit is contained in:
parent
05e8edac43
commit
4eb810e26c
@ -960,3 +960,18 @@ func (db *commonMsgDatabase) SearchMessage(ctx context.Context, req *pbMsg.Searc
|
|||||||
func (db *commonMsgDatabase) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string) {
|
func (db *commonMsgDatabase) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string) {
|
||||||
db.msgDocDatabase.ConvertMsgsDocLen(ctx, conversationIDs)
|
db.msgDocDatabase.ConvertMsgsDocLen(ctx, conversationIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (db *commonMsgDatabase) SearchMsg(ctx context.Context, req *pbMsg.SearchMessageReq) ([]*model.ChatLog, error) {
|
||||||
|
// Construct the database query using the req parameter
|
||||||
|
query := constructQuery(req)
|
||||||
|
|
||||||
|
// Execute the database query
|
||||||
|
chatLogs, err := executeQuery(query)
|
||||||
|
if err != nil {
|
||||||
|
// If the database query fails, return a nil slice and the error
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the database query is successful, return the retrieved chatLogs and a nil error
|
||||||
|
return chatLogs, nil
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user