mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
Refactor user ID access in SignalR hubs and add online user tracking
Introduces IHubUserAccessor and its implementation to centralize user ID retrieval from SignalR HubCallerContext, replacing duplicated logic in ChatsHub, FriendsHub, and PresenceHub. Moves extension and mapping files to a Common directory, adds UserToUserDtoMappingAction for online status mapping, and implements OnlineUserStore with tests for tracking online users. Updates dependency injection and test code to use the new abstractions.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using AutoMapper;
|
||||
using Govor.API.Extensions.Mapping;
|
||||
using Govor.Contracts.DTOs;
|
||||
using Govor.Contracts.Responses;
|
||||
using Govor.Core.Models;
|
||||
using Govor.Core.Models.Messages;
|
||||
using Govor.Core.Models.Users;
|
||||
|
||||
namespace Govor.API.Common.Mapping;
|
||||
|
||||
public class MappingProfile : Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<Message, MessageResponse>();
|
||||
CreateMap<MediaAttachments, MediaAttachmentResponse>();
|
||||
CreateMap<MessageReaction, MessageReactionResponse>();
|
||||
CreateMap<MessageView, MessageViewResponse>();
|
||||
|
||||
CreateMap<User, UserDto>()
|
||||
.AfterMap<UserToUserDtoMappingAction>();
|
||||
|
||||
CreateMap<Friendship, FriendshipDto>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user