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:
Artemy
2025-07-12 16:39:06 +07:00
parent c7de2318fc
commit 96587b491d
22 changed files with 972 additions and 98 deletions
+8 -2
View File
@@ -28,8 +28,8 @@ namespace Govor.ConsoleClient
{
class Program
{
//static string baseUrl = "https://govor-team-govor-88b3.twc1.net";
static string baseUrl = "https://localhost:7155";
static string baseUrl = "https://govor-team-govor-88b3.twc1.net";
//static string baseUrl = "https://localhost:7155";
static string? AuthToken = null;
static HttpClientService HttpService = new(baseUrl);
private static FriendsClient? _friendsClient; // Renamed to avoid conflict with BaseCommand
@@ -42,6 +42,12 @@ namespace Govor.ConsoleClient
static async Task Main()
{
FriendsHubClient client = new FriendsHubClient($"{baseUrl}/hubs/friends", "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI4NDRjNzkyMi1hNjdlLTRlMzctYWI0MC0wNThlZDE5NzM5NjMiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJBZG1pbiIsImV4cCI6MTc1MjMzMjE2NX0.mGSjSCvguEXkdHqHcbZ3eUH0S8c82kz3XP89potEh1k");
await client.StartAsync();
await client.AcceptRequest(Guid.Parse("3ba77c0c-7522-47be-8e77-ea47bd6c6e69"));
return;
InitializeCommands();
BaseCommand.InitializeServices(
_friendsClient, // Initially null, will be set by Login/Register commands