Manage Appointments DONE!
This commit is contained in:
@@ -47,7 +47,7 @@ public class ChatHandler
|
||||
};
|
||||
}
|
||||
|
||||
var chatId = ChatIdentifier.GenerateChatId(sendMessageDto.Sender, sendMessageDto.Receiver);
|
||||
var chatId = IdentifierGenerator.GenerateId(sendMessageDto.Sender, sendMessageDto.Receiver);
|
||||
|
||||
var criteria = new List<(string, string)>();
|
||||
criteria.Add(("_id", chatId));
|
||||
@@ -109,7 +109,7 @@ public class ChatHandler
|
||||
};
|
||||
}
|
||||
|
||||
var chatId = ChatIdentifier.GenerateChatId(getConversationDto.IdUser1, getConversationDto.IdUser2);
|
||||
var chatId = IdentifierGenerator.GenerateId(getConversationDto.IdUser1, getConversationDto.IdUser2);
|
||||
|
||||
var criteria = new List<(string, string)>();
|
||||
criteria.Add(("_id", chatId));
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace Application.Endpoints.Chats;
|
||||
|
||||
public class ChatIdentifier
|
||||
{
|
||||
public static string GenerateChatId(Guid id1, Guid id2)
|
||||
{
|
||||
// Convert GUIDs to strings
|
||||
string strId1 = id1.ToString();
|
||||
string strId2 = id2.ToString();
|
||||
|
||||
// Sort the GUID strings
|
||||
string firstId = strId1.CompareTo(strId2) < 0 ? strId1 : strId2;
|
||||
string secondId = strId1.CompareTo(strId2) < 0 ? strId2 : strId1;
|
||||
|
||||
// Combine them to get a symmetric string
|
||||
return firstId + "-" + secondId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user