mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
Media Controller Tests and other
This commit is contained in:
@@ -15,7 +15,7 @@ public record Media(Guid UploaderId,
|
||||
string FileName,
|
||||
byte[] Data,
|
||||
MediaType Type,
|
||||
string MineType,
|
||||
string MimeType,
|
||||
string EncryptedKey);
|
||||
|
||||
public record MediaUploadResult(Guid? MediaId, string Url);
|
||||
@@ -15,7 +15,7 @@ public interface IMessageCommandService
|
||||
// Task<Result> MarkMessageAsReadAsync(Guid userId, Guid messageId);
|
||||
}
|
||||
|
||||
// Define specific result types for clarity, including original message for notifications if needed
|
||||
|
||||
|
||||
public record SendMessageResult(bool IsSuccess, Exception? Exception, Message Message)
|
||||
: Result(IsSuccess, Exception, Message?.Id ?? Guid.Empty);
|
||||
@@ -23,7 +23,7 @@ public record SendMessageResult(bool IsSuccess, Exception? Exception, Message Me
|
||||
public record EditMessageResult(bool IsSuccess, Exception? Exception, Message? OriginalMessage)
|
||||
: Result(IsSuccess, Exception, OriginalMessage?.Id ?? Guid.Empty)
|
||||
{
|
||||
// OriginalMessage can be useful for the Hub to know details like RecipientType, RecipientId for notifications
|
||||
|
||||
}
|
||||
|
||||
public record DeleteMessageResult(bool IsSuccess, Exception? Exception, Message? OriginalMessage)
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MediaService : IMediaService
|
||||
UploaderId = file.UploaderId,
|
||||
DateCreated = file.UploadedOn,
|
||||
MediaType = file.Type,
|
||||
MineType = file.MineType,
|
||||
MineType = file.MimeType,
|
||||
Url = url
|
||||
});
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace Govor.Application.Services.Messages;
|
||||
public class MessageCommandService : IMessageCommandService
|
||||
{
|
||||
private readonly IMessagesRepository _messagesRepository;
|
||||
private readonly IUsersRepository _usersRepository; // For validating user recipients
|
||||
private readonly IGroupsRepository _groupsRepository; // For validating group recipients and fetching members
|
||||
private readonly IUsersRepository _usersRepository;
|
||||
private readonly IGroupsRepository _groupsRepository;
|
||||
private readonly IPrivateChatsRepository _privateChats;
|
||||
private readonly IVerifyFriendship _verifyFriendship; // For private messages
|
||||
private readonly IVerifyFriendship _verifyFriendship;
|
||||
private readonly ILogger<MessageCommandService> _logger;
|
||||
|
||||
public MessageCommandService(
|
||||
|
||||
Reference in New Issue
Block a user