|
|
|
@@ -1,46 +1,27 @@
|
|
|
|
|
using Govor.API.Common.Mapping;
|
|
|
|
|
using Govor.API.Common.SignalR.Helpers;
|
|
|
|
|
using Govor.API.Hubs.Infrastructure;
|
|
|
|
|
using Govor.Application.Authentication;
|
|
|
|
|
using Govor.Application.Authentication.JWT;
|
|
|
|
|
using Govor.Application.Friends;
|
|
|
|
|
using Govor.Application.Groups;
|
|
|
|
|
using Govor.Application.Infrastructure.AdminsStuff;
|
|
|
|
|
using Govor.Application.Infrastructure.Extensions;
|
|
|
|
|
using Govor.Application.Infrastructure.Validators;
|
|
|
|
|
using Govor.Application.Interfaces;
|
|
|
|
|
using Govor.Application.Interfaces.Authentication;
|
|
|
|
|
using Govor.Application.Interfaces.Friends;
|
|
|
|
|
using Govor.Application.Interfaces.Infrastructure.Extensions;
|
|
|
|
|
using Govor.Application.Interfaces.Medias;
|
|
|
|
|
using Govor.Application.Interfaces.Messages;
|
|
|
|
|
using Govor.Application.Interfaces.PushNotifications;
|
|
|
|
|
using Govor.Application.Interfaces.UserOnlineStatus;
|
|
|
|
|
using Govor.Application.Interfaces.UserSession;
|
|
|
|
|
using Govor.Application.Interfaces.UserSession.Crypto;
|
|
|
|
|
using Govor.Application.Services;
|
|
|
|
|
using Govor.Application.Services.Authentication;
|
|
|
|
|
using Govor.Application.Services.Friends;
|
|
|
|
|
using Govor.Application.Services.Medias;
|
|
|
|
|
using Govor.Application.Services.Messages;
|
|
|
|
|
using Govor.Application.Services.PushNotifications;
|
|
|
|
|
using Govor.Application.Services.PushNotifications.Providers;
|
|
|
|
|
using Govor.Application.Services.UserOnlineStatus;
|
|
|
|
|
using Govor.Application.Services.UserSessions;
|
|
|
|
|
using Govor.Application.Services.UserSessions.Crypto;
|
|
|
|
|
using Govor.Core.Infrastructure.Extensions;
|
|
|
|
|
using Govor.Core.Infrastructure.Validators;
|
|
|
|
|
using Govor.Core.Models;
|
|
|
|
|
using Govor.Core.Models.Messages;
|
|
|
|
|
using Govor.Core.Models.Users;
|
|
|
|
|
using Govor.Core.Repositories.Admins;
|
|
|
|
|
using Govor.Core.Repositories.Friendships;
|
|
|
|
|
using Govor.Core.Repositories.Groups;
|
|
|
|
|
using Govor.Core.Repositories.Invaites;
|
|
|
|
|
using Govor.Core.Repositories.MediasAttachments;
|
|
|
|
|
using Govor.Core.Repositories.Messages;
|
|
|
|
|
using Govor.Core.Repositories.PrivateChats;
|
|
|
|
|
using Govor.Core.Repositories.PushTokens;
|
|
|
|
|
using Govor.Core.Repositories.Users;
|
|
|
|
|
using Govor.Core.Repositories.UserSessionsRepository;
|
|
|
|
|
using Govor.Data;
|
|
|
|
|
using Govor.Data.Repositories;
|
|
|
|
|
using Govor.Application.Medias;
|
|
|
|
|
using Govor.Application.Messages;
|
|
|
|
|
using Govor.Application.PingHandler;
|
|
|
|
|
using Govor.Application.PrivateUserChats;
|
|
|
|
|
using Govor.Application.Profiles;
|
|
|
|
|
using Govor.Application.PushNotifications;
|
|
|
|
|
using Govor.Application.PushNotifications.Providers;
|
|
|
|
|
using Govor.Application.Storage;
|
|
|
|
|
using Govor.Application.Synching;
|
|
|
|
|
using Govor.Application.Users;
|
|
|
|
|
using Govor.Application.Users.UserOnlineStatus;
|
|
|
|
|
using Govor.Application.Users.UserSessions;
|
|
|
|
|
using Govor.Application.Users.UserSessions.Crypto;
|
|
|
|
|
using Govor.Domain;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Govor.API.Common.Extensions;
|
|
|
|
@@ -56,6 +37,7 @@ public static class ConfigurationProgramExtensions
|
|
|
|
|
services.AddScoped<IAccountService, AuthService>();
|
|
|
|
|
services.AddScoped<IUsersAdministration, UsersService>();
|
|
|
|
|
services.AddScoped<IInvitesService, InvitesService>();
|
|
|
|
|
services.AddScoped<IInvitationGetter, InvitationGetter>();
|
|
|
|
|
services.AddScoped<IInvitationGenerator, InvitationGenerator>();
|
|
|
|
|
services.AddScoped<ISynchingService, SynchingService>();
|
|
|
|
|
|
|
|
|
@@ -80,7 +62,10 @@ public static class ConfigurationProgramExtensions
|
|
|
|
|
|
|
|
|
|
services.AddScoped<IUserGroupsGetterService, UserGroupsGetterService>();
|
|
|
|
|
|
|
|
|
|
services.AddScoped<IMessageCommandService, MessageCommandService>();
|
|
|
|
|
//services.AddScoped<IMessageCommandService, MessageCommandService>();
|
|
|
|
|
services.AddScoped<IMessageSendingService, MessageSendingService>();
|
|
|
|
|
services.AddScoped<IMessageEditingService, MessageEditingService>();
|
|
|
|
|
services.AddScoped<IMessageRemovingService, MessageRemovingService>();
|
|
|
|
|
services.AddScoped<IVerifyFriendship, VerifyFriendship>();
|
|
|
|
|
services.AddScoped<IUserPrivateChatsGetterService, UserPrivateChatsGetter>();
|
|
|
|
|
services.AddScoped<IUserPrivateChatsCreator, UserPrivateChatsCreator>();
|
|
|
|
@@ -88,6 +73,9 @@ public static class ConfigurationProgramExtensions
|
|
|
|
|
services.AddScoped<IMediaService, MediaService>();
|
|
|
|
|
services.AddScoped<IAccesserToDownloadMedia, AccesserToDownloadMediaService>();
|
|
|
|
|
|
|
|
|
|
// User
|
|
|
|
|
services.AddScoped<IUserNameExistValidator, UserNameExistValidator>();
|
|
|
|
|
|
|
|
|
|
// UserSession
|
|
|
|
|
services.AddScoped<IUserSessionOpener, UserSessionOpener>();
|
|
|
|
|
services.AddScoped<IUserSessionRefresher, UserSessionRefresher>();
|
|
|
|
@@ -104,6 +92,7 @@ public static class ConfigurationProgramExtensions
|
|
|
|
|
services.AddSingleton<IConnectionStore, ConnectionStore>();
|
|
|
|
|
|
|
|
|
|
// Pushs
|
|
|
|
|
services.AddScoped<IPushTokenService, PushTokenService>();
|
|
|
|
|
services.AddScoped<IPushNotificationService, PushNotificationService>();
|
|
|
|
|
services.AddSingleton<IPushNotificationProvider, FirebasePushProvider>();
|
|
|
|
|
|
|
|
|
@@ -122,34 +111,7 @@ public static class ConfigurationProgramExtensions
|
|
|
|
|
|
|
|
|
|
services.AddScoped<IProfileService, ProfileService>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void AddRepositories(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped<IUsersRepository, UsersRepository>();
|
|
|
|
|
services.AddScoped<IMessagesRepository, MessagesRepository>();
|
|
|
|
|
services.AddScoped<IInvitesRepository, InvitesRepository>();
|
|
|
|
|
services.AddScoped<IAdminsRepository, AdminsRepository>();
|
|
|
|
|
services.AddScoped<IMediaAttachmentsRepository, MediaAttachmentsRepository>();
|
|
|
|
|
services.AddScoped<IFriendshipsRepository, FriendshipsRepository>();
|
|
|
|
|
services.AddScoped<IPrivateChatsRepository, PrivateChatsRepository>();
|
|
|
|
|
services.AddScoped<IGroupsRepository, GroupRepository>();
|
|
|
|
|
services.AddScoped<IUserSessionsRepository, UserSessionsRepository>();
|
|
|
|
|
services.AddScoped<IPushTokenRepository, PushTokenRepository>();
|
|
|
|
|
// other
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void AddValidators(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped<IObjectValidator<User>, UserValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<Message>, MessageValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<MediaAttachments>, MediaAttachmentsValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<Admin>, AdminValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<Invitation>, InvitationValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<Friendship>, FriendshipValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<PrivateChat>, PrivateChatValidator>();
|
|
|
|
|
services.AddScoped<IObjectValidator<ChatGroup>, ChatGroupValidator>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddGovorDbContext(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
var useMySql = configuration.GetValue<bool>("UseMySql");
|
|
|
|
|