mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-18 20:19:14 +08:00
Completed the implementation of the SearchMsg function
This commit is contained in:
parent
2e861a6929
commit
8aa870ce3f
@ -23,7 +23,23 @@ func (s *msgServer) SearchMsg(ctx context.Context, req *pb.SearchMsgReq) (*pb.Se
|
|||||||
return &pb.SearchMsgResp{}, nil
|
return &pb.SearchMsgResp{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rest of the function implementation
|
// Initialize a slice of pb.ChatLog objects
|
||||||
// ...
|
var pbChatLogs []*pb.ChatLog
|
||||||
|
|
||||||
|
// Iterate over the chatLogs slice
|
||||||
|
for _, chatLog := range chatLogs {
|
||||||
|
// Create a pb.ChatLog object for each chatLog and append it to the pbChatLogs slice
|
||||||
|
pbChatLog := &pb.ChatLog{
|
||||||
|
SenderID: chatLog.SenderID,
|
||||||
|
ReceiverID: chatLog.ReceiverID,
|
||||||
|
Content: chatLog.Content,
|
||||||
|
ContentType: chatLog.ContentType,
|
||||||
|
Timestamp: chatLog.Timestamp,
|
||||||
|
}
|
||||||
|
pbChatLogs = append(pbChatLogs, pbChatLog)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the pbChatLogs slice in the pb.SearchMsgResp object
|
||||||
|
return &pb.SearchMsgResp{ChatLogs: pbChatLogs}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user