Files
Artemy 6d1c53beeb Refactor: migrate Core -> Domain and reorganize projects
Large refactor that renames/moves core types into a new Govor.Domain surface and reorganizes the Application layer. Models, configurations, migrations and many files moved from Govor.Core/Govor.Data to Govor.Domain; numerous Application services, interfaces and implementations were relocated or added (authentication, friends, messages, medias, push notifications, user sessions, storage, synching, private chats, etc.). Tests updated to use Govor.Domain namespaces and adjusted project references (removed Govor.Data reference from API tests). Also updated API, Hub and mapping code and project files to reflect the new structure and naming. This is primarily a codebase-wide namespace and module reorganization to establish a Domain project and restructure application services.
2026-07-16 19:27:45 +07:00

27 lines
801 B
C#

using Govor.Domain.Models;
using Govor.Domain.Models.Messages;
namespace Govor.Application.Medias;
public interface IMediaService
{
public Task<MediaUploadResult> UploadMediaAsync(Media file);
public Task DeleteMediaAsync(Guid fileId);
public Task<Media> GetMediaByUrlAsync(string url);
public Task<Media> GetMediaByIdAsync(Guid mediaId);
public Task<bool> HasMediaAsync(Guid mediaId);
public Task<bool> HasMediaByUrlAsync(string url);
Task AttachToMessageAsync(Guid mediaId, Guid messageId);
}
public record Media(Guid UploaderId,
DateTime UploadedOn,
string FileName,
byte[] Data,
MediaType Type,
string MimeType,
string EncryptedKey,
MediaOwnerType OwnerType,
Guid? OwnerId);
public record MediaUploadResult(Guid MediaId, string Url);