Updated pkg/common/db/controller/msg.go

pull/864/head
sweep-ai[bot] 2 years ago committed by GitHub
parent 05e8edac43
commit 4eb810e26c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -960,3 +960,18 @@ func (db *commonMsgDatabase) SearchMessage(ctx context.Context, req *pbMsg.Searc
func (db *commonMsgDatabase) ConvertMsgsDocLen(ctx context.Context, conversationIDs []string) {
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…
Cancel
Save