Skip to content

Commit 7a67bc4

Browse files
authored
Merge pull request #400 from Ketteiteki/remove_unused_classes_and_move_registration_services
remove unused classes and move registration services
2 parents 6161fe9 + 96cb24d commit 7a67bc4

88 files changed

Lines changed: 220 additions & 282 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MangoAPI.BusinessLogic/ApiCommands/Users/RegisterResponse.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

MangoAPI.BusinessLogic/ApiCommands/Users/UpdateUserAccountInfoCommandValidator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using FluentValidation;
2-
using System;
32
using System.Linq;
43

54
namespace MangoAPI.BusinessLogic.ApiCommands.Users;

MangoAPI.BusinessLogic/Configuration/MangoStartup.cs

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
using MangoAPI.Application.Interfaces;
1+
using FluentValidation;
2+
using MangoAPI.Application.Interfaces;
23
using MangoAPI.Application.Services;
4+
using MangoAPI.BusinessLogic.ApiCommands.Sessions;
5+
using MangoAPI.BusinessLogic.ApiCommands.Users;
36
using MangoAPI.BusinessLogic.DependencyInjection;
7+
using MangoAPI.BusinessLogic.Pipelines;
8+
using MangoAPI.BusinessLogic.Responses;
9+
using MediatR;
410
using Microsoft.Extensions.DependencyInjection;
511

612
namespace MangoAPI.BusinessLogic.Configuration;
@@ -23,8 +29,6 @@ public static void Initialize(
2329

2430
services.AddDatabaseContextServices(databaseConnectionString);
2531

26-
services.AddAppInfrastructure(mangoJwtSignKey, mangoJwtIssuer, mangoJwtAudience);
27-
2832
services.AddAzureBlobServices(
2933
mangoBlobUrl,
3034
mangoBlobContainerName,
@@ -38,7 +42,7 @@ public static void Initialize(
3842
mangoRefreshTokenLifetimeDays);
3943

4044
services.AddSingInManagerServices();
41-
services.AddPasswordHashServices();
45+
4246
services.AddSignalR();
4347

4448
services.AddSingleton<IVersionService, VersionService>();
@@ -47,6 +51,31 @@ public static void Initialize(
4751

4852
services.AddScoped<IAvatarService, AvatarService>();
4953

54+
services.AddValidatorsFromAssembly(typeof(LoginCommandValidator).Assembly);
55+
56+
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviour<,>));
57+
58+
services.AddTransient(typeof(ResponseFactory<>));
59+
60+
services.AddMediatR(typeof(RegisterCommandHandler).Assembly);
61+
62+
services.AddScoped<PasswordHashService>();
63+
64+
services.AddIdentityUsers();
65+
66+
services.AddSignalR();
67+
68+
services.AddAppAuthorization();
69+
70+
services.AddAppAuthentication(
71+
mangoJwtSignKey,
72+
mangoJwtIssuer,
73+
mangoJwtAudience);
74+
75+
services.AddLogging();
76+
77+
services.AddHttpClient();
78+
5079
var provider = services.BuildServiceProvider();
5180
MangoCompositionRoot.SetProvider(provider);
5281
}

MangoAPI.BusinessLogic/DependencyInjection/CorsServices.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
using System;
2-
using Microsoft.Extensions.Configuration;
1+
using Microsoft.Extensions.Configuration;
32
using Microsoft.Extensions.DependencyInjection;
43

54
namespace MangoAPI.BusinessLogic.DependencyInjection;
65

7-
[Obsolete("Application does not do cross origin requests.")]
86
public static class CorsServices
97
{
108
public static IServiceCollection ConfigureCors(

MangoAPI.BusinessLogic/DependencyInjection/InfrastructureServices.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.

MangoAPI.BusinessLogic/DependencyInjection/MailgunDependencyInjection.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

MangoAPI.BusinessLogic/DependencyInjection/MediatorValidatorsAndResponseFactoryDependencyInjection.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

MangoAPI.BusinessLogic/DependencyInjection/MessengerServices.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

MangoAPI.BusinessLogic/DependencyInjection/PasswordHashServiceDependencyInjection.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

MangoAPI.BusinessLogic/DependencyInjection/SwaggerServices.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace MangoAPI.BusinessLogic.DependencyInjection;
66

77
public static class SwaggerServices
88
{
9-
public static IServiceCollection AddSwagger(this IServiceCollection services)
9+
public static IServiceCollection AddSwagger(this IServiceCollection services, string title, string version)
1010
{
1111
services.AddSwaggerGen(c =>
1212
{
1313
c.EnableAnnotations();
14-
c.SwaggerDoc("v1", new OpenApiInfo { Title = "MangoAPI", Version = "v1" });
14+
c.SwaggerDoc($"v{version}", new OpenApiInfo { Title = $"{title}", Version = $"v{version}" });
1515

1616
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
1717
{

0 commit comments

Comments
 (0)