mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-22 20:24:55 +00:00
test to make server
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Govor.API.Common.Mapping;
|
||||
using Govor.API.Common.SignalR.Helpers;
|
||||
using Govor.API.Hubs.Infrastructure;
|
||||
using Govor.Application.Infrastructure.AdminsStuff;
|
||||
using Govor.Application.Infrastructure.Extensions;
|
||||
using Govor.Application.Infrastructure.Validators;
|
||||
@@ -52,6 +53,7 @@ public static class ConfigurationProgramExtensions
|
||||
services.AddScoped<IInvitesService, InvitesService>();
|
||||
services.AddScoped<IInvitationGenerator, InvitationGenerator>();
|
||||
services.AddScoped<IUsernameValidator, UsernameValidator>();
|
||||
services.AddScoped<ISynchingService, SynchingService>();
|
||||
|
||||
// Friends services
|
||||
services.AddScoped<IFriendshipService, FriendshipService>();
|
||||
@@ -74,7 +76,8 @@ public static class ConfigurationProgramExtensions
|
||||
|
||||
services.AddScoped<IMessageCommandService, MessageCommandService>();
|
||||
services.AddScoped<IVerifyFriendship, VerifyFriendship>();
|
||||
services.AddScoped<IUserGroupsService, UserGroupsService>();
|
||||
services.AddScoped<IUserGroupsGetterService, UserGroupsGetterService>();
|
||||
services.AddScoped<IUserPrivateChatsGetterService, UserPrivateChatsGetter>();
|
||||
services.AddScoped<IMessagesLoader, MessagesLoader>();
|
||||
services.AddScoped<IMediaService, MediaService>();
|
||||
services.AddScoped<IAccesserToDownloadMedia, AccesserToDownloadMediaService>();
|
||||
@@ -87,6 +90,10 @@ public static class ConfigurationProgramExtensions
|
||||
services.AddScoped<IUserPresenceReader, UserPresenceReader>();
|
||||
services.AddSingleton<IOnlineUserStore, OnlineUserStore>();
|
||||
|
||||
// Hubs Infrastructure
|
||||
services.AddScoped<IChatNotificationService, ChatNotificationService>();
|
||||
services.AddScoped<IConnectionManager, ConnectionManager>();
|
||||
|
||||
// Auto Mapper
|
||||
services.AddAutoMapper(typeof(MappingProfile));
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ public class MappingProfile : Profile
|
||||
|
||||
CreateMap<User, UserDto>()
|
||||
.AfterMap<UserToUserDtoMappingAction>();
|
||||
|
||||
CreateMap<UserProfile, UserProfileDto>()
|
||||
.AfterMap<UserProfileToUserProfileDtoMappingAction>();
|
||||
|
||||
CreateMap<Friendship, FriendshipDto>();
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using AutoMapper;
|
||||
using Govor.Application.Interfaces.UserOnlineStatus;
|
||||
using Govor.Application.Profiles;
|
||||
using Govor.Contracts.DTOs;
|
||||
using Govor.Core.Models.Users;
|
||||
|
||||
namespace Govor.API.Common.Mapping;
|
||||
|
||||
public class UserProfileToUserProfileDtoMappingAction : IMappingAction<UserProfile, UserProfileDto>
|
||||
{
|
||||
private readonly IOnlineUserStore _onlineUserStore;
|
||||
|
||||
public UserProfileToUserProfileDtoMappingAction(IOnlineUserStore onlineUserStore)
|
||||
{
|
||||
_onlineUserStore = onlineUserStore;
|
||||
}
|
||||
|
||||
public void Process(UserProfile source, UserProfileDto destination, ResolutionContext context)
|
||||
{
|
||||
destination.IsOnline = _onlineUserStore.IsOnline(source.Id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user