MediaAttachments first init

This commit is contained in:
Artemy
2025-06-22 15:10:10 +07:00
parent b75c0d3f5a
commit 64a06c0d1c
6 changed files with 94 additions and 2 deletions
+2 -2
View File
@@ -6,10 +6,10 @@ public class MediaAttachments
public Guid MessageId { get; set; }
public MediaType Type { get; set; }
public string FilePath { get; set; } = string.Empty; // путь к файлу (локальный или URL)
public string FilePath { get; set; } = string.Empty; // local path in filesystem
public string MimeType { get; set; } = string.Empty;
public string? EncryptedKey { get; set; } // если используется отдельное шифрование
public string? EncryptedKey { get; set; }
public Message Message { get; set; } = null!;
}
@@ -0,0 +1,9 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories.MediasAttachments;
public interface IMediaAttachmentsExist
{
bool Exists(Guid id);
bool Exists(MediaAttachments attachments);
}
@@ -0,0 +1,9 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories.MediasAttachments;
public interface IMediaAttachmentsReader
{
Task<List<MediaAttachments>> GetAllAsync();
Task<List<MediaAttachments>> GetAllByMessageId(Guid messageId);
}
@@ -0,0 +1,6 @@
namespace Govor.Core.Repositories.MediasAttachments;
public interface IMediaAttachmentsRepository : IMediaAttachmentsReader, IMediaAttachmentsWriter, IMediaAttachmentsExist
{
}
@@ -0,0 +1,10 @@
using Govor.Core.Models;
namespace Govor.Core.Repositories.MediasAttachments;
public interface IMediaAttachmentsWriter
{
Task AddAsync(MediaAttachments mediaAttachments);
Task UpdateAsync(MediaAttachments mediaAttachments);
Task RemoveAsync(Guid Id);
}