mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
96587b491d
Introduced AutoMapper to the API project and registered it in the DI container. Added mapping profiles for core models to DTOs and response objects. Refactored controllers to use AutoMapper for mapping entities to response DTOs. Implemented new response models for messages, media attachments, reactions, and views. Updated MessagesLoader to load messages with related data. Added a migration to support ChatGroupId in messages. Updated dependencies and fixed minor issues in related files.
20 lines
765 B
C#
20 lines
765 B
C#
using Govor.Core.Models.Messages;
|
|
|
|
namespace Govor.Contracts.Responses;
|
|
|
|
public class MessageResponse
|
|
{
|
|
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 Guid? ReplyToMessageId { get; set; }
|
|
|
|
public List<MediaAttachmentResponse> MediaAttachments { get; set; } = new();
|
|
public List<MessageReactionResponse> Reactions { get; set; } = new();
|
|
public List<MessageViewResponse> MessageViews { get; set; } = new();
|
|
} |