mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
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.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace Govor.Domain.Models.Messages;
|
||||
|
||||
public class MediaAttachments
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid MessageId { get; set; }
|
||||
public Guid MediaFileId { get; set; }
|
||||
public Message Message { get; set; }
|
||||
public MediaFile MediaFile { get; set; }
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not MediaAttachments other) return false;
|
||||
|
||||
return Id == other.Id &&
|
||||
MessageId == other.MessageId &&
|
||||
MediaFileId == other.MediaFileId;
|
||||
}
|
||||
}
|
||||
|
||||
public enum MediaType
|
||||
{
|
||||
Image,
|
||||
Video,
|
||||
Audio,
|
||||
File,
|
||||
Voice
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
namespace Govor.Domain.Models.Messages;
|
||||
|
||||
public class Message
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid SenderId { get; set; }
|
||||
public Guid RecipientId { get; set; } // or GroupId
|
||||
public RecipientType RecipientType { get; set; }
|
||||
public string EncryptedContent { get; set; } = string.Empty;
|
||||
public DateTime SentAt { get; set; }
|
||||
public bool IsEdited { get; set; } = false;
|
||||
public DateTime? EditedAt { get; set; }
|
||||
public List<MessageReaction> Reactions { get; set; } = new List<MessageReaction>();
|
||||
public List<MediaAttachments> MediaAttachments { get; set; } = new List<MediaAttachments>();
|
||||
public List<MessageView> MessageViews { get; set; } = new List<MessageView>();
|
||||
|
||||
public Guid? ReplyToMessageId { get; set; }
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not Message other) return false;
|
||||
|
||||
return Id == other.Id &&
|
||||
SenderId == other.SenderId &&
|
||||
RecipientId == other.RecipientId &&
|
||||
RecipientType == other.RecipientType &&
|
||||
EncryptedContent == other.EncryptedContent &&
|
||||
SentAt == other.SentAt &&
|
||||
IsEdited == other.IsEdited &&
|
||||
EditedAt == other.EditedAt &&
|
||||
ReplyToMessageId == other.ReplyToMessageId;
|
||||
}
|
||||
}
|
||||
|
||||
public enum RecipientType
|
||||
{
|
||||
User,
|
||||
Group
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Govor.Domain.Models.Users;
|
||||
|
||||
namespace Govor.Domain.Models.Messages;
|
||||
|
||||
public class MessageReaction
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid MessageId { get; set; }
|
||||
public Message Message { get; set; }
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; }
|
||||
|
||||
public string ReactionCode { get; set; } // "❤️", "🔥", "👍", ":custom_emoji:"
|
||||
public DateTime ReactedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Govor.Domain.Models.Messages;
|
||||
|
||||
public class MessageView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid MessageId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public DateTime ViewedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user