mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Add AutoMapper and message response models
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.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Govor.Core.Models.Messages;
|
||||
|
||||
namespace Govor.Core.Models;
|
||||
|
||||
public class ChatGroup
|
||||
@@ -11,7 +13,8 @@ public class ChatGroup
|
||||
public List<GroupAdmins> Admins { get; set; } = new();
|
||||
public List<GroupMembership> Members { get; set; } = new();
|
||||
public List<GroupInvitation> InviteCodes { get; set; } = new();
|
||||
|
||||
public List<Message> Messages { get; set; } = new();
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
ChatGroup chatGroup = obj as ChatGroup;
|
||||
|
||||
@@ -7,7 +7,7 @@ public class PrivateChat
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserAId { get; set; }
|
||||
public Guid UserBId { get; set; }
|
||||
public List<Message> Messages { get; set; } = new List<Message>();
|
||||
public List<Message> Messages { get; set; } = new();
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Govor.Core.Repositories.Groups;
|
||||
|
||||
namespace Govor.Core.Repositories.PrivateChats;
|
||||
|
||||
public interface IPrivateChatsRepository : IPrivateChatsReader, IPrivateChatsWriter, IPrivateChatsExist
|
||||
|
||||
Reference in New Issue
Block a user