Initial commit carried over from private repo. This is V2.
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m3s
Build and Push Docker Image / docker (push) Successful in 43s

This commit is contained in:
2025-07-04 21:24:12 +02:00
parent 7715816029
commit 4393977389
96 changed files with 3223 additions and 0 deletions

View File

@ -0,0 +1,22 @@
namespace MessengerApi.Contracts.MessageParser
{
/// <summary>
/// A tool that helps converting POCO request/response models into <see cref="InboxMessage"/>, <see cref="OutboxMessage"/> and back.
/// </summary>
/// <remarks>
/// If you implement this, it's gonna be a lot easier for you to translate
/// dumb request class into <see cref="OutboxMessage"/>, then convert
/// <see cref="InboxMessage"/> back to request at server-side, and do the
/// same with the response all the way down to the client.
/// </remarks>
public interface IMessageParser<TRequest, TResponse>
{
OutboxMessage GetMessageFromRequest(TRequest request, int targetUserId);
TRequest GetRequestFromMessage(InboxMessage message);
OutboxMessage GetMessageFromResponse(TResponse response, string apiKey, int targetUserId, InboxMessage requestOrigin = null);
TResponse GetResponseFromMessage(InboxMessage message);
}
}