From 1c981fb7bf06179ce650023a44388a3c255af37f Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Mon, 7 Oct 2024 02:13:35 +0300 Subject: [PATCH] refactor: code restructuring --- Endpoint/Common/Services/PairPeriodTimeConverter.cs | 2 +- .../Core}/Middleware/CacheMaxAgeMiddleware.cs | 2 +- .../Core}/Middleware/CustomExceptionHandlerMiddleware.cs | 0 .../Core}/Middleware/JwtRevocationMiddleware.cs | 0 .../Core}/Middleware/MaintenanceModeMiddleware.cs | 0 .../Startup}/ApiVersioningConfiguration.cs | 2 +- .../Startup}/CacheConfiguration.cs | 6 +++--- .../Startup}/EnvironmentConfiguration.cs | 2 +- .../Startup}/JwtConfiguration.cs | 2 +- .../Startup}/LoggerConfiguration.cs | 4 ++-- .../Startup}/SecureConfiguration.cs | 6 +++--- .../Startup}/SwaggerConfiguration.cs | 2 +- .../Configuration/General/Interfaces/IIsConfigured.cs | 6 ------ .../{Common/Settings => Configuration}/ISaveSettings.cs | 2 +- .../{Common/Settings => Configuration/Model}/Admin.cs | 5 +++-- .../Settings => Configuration/Model}/GeneralConfig.cs | 7 ++++--- .../Attributes/RequiredSettingsAttribute.cs | 2 +- .../Configuration/Validation/Interfaces/IIsConfigured.cs | 6 ++++++ .../{General => Validation}/Settings/CacheSettings.cs | 6 +++--- .../{General => Validation}/Settings/DbSettings.cs | 6 +++--- .../{General => Validation}/Settings/EmailSettings.cs | 4 ++-- .../{General => Validation}/Settings/LogSettings.cs | 6 +++--- .../{General => Validation}/Settings/ScheduleSettings.cs | 6 +++--- .../{General => Validation}/SetupTokenService.cs | 2 +- .../Validators/SettingsRequiredValidator.cs | 8 ++++---- Endpoint/Controllers/Configuration/SetupController.cs | 7 +++---- Endpoint/Controllers/V1/AuthController.cs | 2 +- Endpoint/Controllers/V1/ScheduleController.cs | 2 +- Endpoint/Program.cs | 8 ++++---- 29 files changed, 57 insertions(+), 56 deletions(-) rename Endpoint/{ => Configuration/Core}/Middleware/CacheMaxAgeMiddleware.cs (98%) rename Endpoint/{ => Configuration/Core}/Middleware/CustomExceptionHandlerMiddleware.cs (100%) rename Endpoint/{ => Configuration/Core}/Middleware/JwtRevocationMiddleware.cs (100%) rename Endpoint/{ => Configuration/Core}/Middleware/MaintenanceModeMiddleware.cs (100%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/ApiVersioningConfiguration.cs (90%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/CacheConfiguration.cs (78%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/EnvironmentConfiguration.cs (97%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/JwtConfiguration.cs (97%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/LoggerConfiguration.cs (96%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/SecureConfiguration.cs (82%) rename Endpoint/Configuration/{ApplicationConfiguration => Core/Startup}/SwaggerConfiguration.cs (97%) delete mode 100644 Endpoint/Configuration/General/Interfaces/IIsConfigured.cs rename Endpoint/{Common/Settings => Configuration}/ISaveSettings.cs (53%) rename Endpoint/{Common/Settings => Configuration/Model}/Admin.cs (80%) rename Endpoint/{Common/Settings => Configuration/Model}/GeneralConfig.cs (79%) rename Endpoint/Configuration/{General => Validation}/Attributes/RequiredSettingsAttribute.cs (70%) create mode 100644 Endpoint/Configuration/Validation/Interfaces/IIsConfigured.cs rename Endpoint/Configuration/{General => Validation}/Settings/CacheSettings.cs (64%) rename Endpoint/Configuration/{General => Validation}/Settings/DbSettings.cs (79%) rename Endpoint/Configuration/{General => Validation}/Settings/EmailSettings.cs (79%) rename Endpoint/Configuration/{General => Validation}/Settings/LogSettings.cs (63%) rename Endpoint/Configuration/{General => Validation}/Settings/ScheduleSettings.cs (82%) rename Endpoint/Configuration/{General => Validation}/SetupTokenService.cs (90%) rename Endpoint/Configuration/{General => Validation}/Validators/SettingsRequiredValidator.cs (79%) diff --git a/Endpoint/Common/Services/PairPeriodTimeConverter.cs b/Endpoint/Common/Services/PairPeriodTimeConverter.cs index ad46295..d4efc40 100644 --- a/Endpoint/Common/Services/PairPeriodTimeConverter.cs +++ b/Endpoint/Common/Services/PairPeriodTimeConverter.cs @@ -1,4 +1,4 @@ -using Mirea.Api.Endpoint.Configuration.General.Settings; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; using System.Collections.Generic; using System.Linq; diff --git a/Endpoint/Middleware/CacheMaxAgeMiddleware.cs b/Endpoint/Configuration/Core/Middleware/CacheMaxAgeMiddleware.cs similarity index 98% rename from Endpoint/Middleware/CacheMaxAgeMiddleware.cs rename to Endpoint/Configuration/Core/Middleware/CacheMaxAgeMiddleware.cs index 0a8f788..03b4c5a 100644 --- a/Endpoint/Middleware/CacheMaxAgeMiddleware.cs +++ b/Endpoint/Configuration/Core/Middleware/CacheMaxAgeMiddleware.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Mirea.Api.Endpoint.Common.Attributes; -using Mirea.Api.Endpoint.Common.Settings; +using Mirea.Api.Endpoint.Configuration.Model; using System; using System.Reflection; using System.Threading.Tasks; diff --git a/Endpoint/Middleware/CustomExceptionHandlerMiddleware.cs b/Endpoint/Configuration/Core/Middleware/CustomExceptionHandlerMiddleware.cs similarity index 100% rename from Endpoint/Middleware/CustomExceptionHandlerMiddleware.cs rename to Endpoint/Configuration/Core/Middleware/CustomExceptionHandlerMiddleware.cs diff --git a/Endpoint/Middleware/JwtRevocationMiddleware.cs b/Endpoint/Configuration/Core/Middleware/JwtRevocationMiddleware.cs similarity index 100% rename from Endpoint/Middleware/JwtRevocationMiddleware.cs rename to Endpoint/Configuration/Core/Middleware/JwtRevocationMiddleware.cs diff --git a/Endpoint/Middleware/MaintenanceModeMiddleware.cs b/Endpoint/Configuration/Core/Middleware/MaintenanceModeMiddleware.cs similarity index 100% rename from Endpoint/Middleware/MaintenanceModeMiddleware.cs rename to Endpoint/Configuration/Core/Middleware/MaintenanceModeMiddleware.cs diff --git a/Endpoint/Configuration/ApplicationConfiguration/ApiVersioningConfiguration.cs b/Endpoint/Configuration/Core/Startup/ApiVersioningConfiguration.cs similarity index 90% rename from Endpoint/Configuration/ApplicationConfiguration/ApiVersioningConfiguration.cs rename to Endpoint/Configuration/Core/Startup/ApiVersioningConfiguration.cs index f92706e..151d5fb 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/ApiVersioningConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/ApiVersioningConfiguration.cs @@ -1,7 +1,7 @@ using Asp.Versioning; using Microsoft.Extensions.DependencyInjection; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class ApiVersioningConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/CacheConfiguration.cs b/Endpoint/Configuration/Core/Startup/CacheConfiguration.cs similarity index 78% rename from Endpoint/Configuration/ApplicationConfiguration/CacheConfiguration.cs rename to Endpoint/Configuration/Core/Startup/CacheConfiguration.cs index ccee805..8239398 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/CacheConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/CacheConfiguration.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Mirea.Api.Endpoint.Common.Settings; -using Mirea.Api.Endpoint.Configuration.General.Settings; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; +using Mirea.Api.Endpoint.Configuration.Model; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class CacheConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/EnvironmentConfiguration.cs b/Endpoint/Configuration/Core/Startup/EnvironmentConfiguration.cs similarity index 97% rename from Endpoint/Configuration/ApplicationConfiguration/EnvironmentConfiguration.cs rename to Endpoint/Configuration/Core/Startup/EnvironmentConfiguration.cs index 6ac90c6..2c10eb3 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/EnvironmentConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/EnvironmentConfiguration.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class EnvironmentConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/JwtConfiguration.cs b/Endpoint/Configuration/Core/Startup/JwtConfiguration.cs similarity index 97% rename from Endpoint/Configuration/ApplicationConfiguration/JwtConfiguration.cs rename to Endpoint/Configuration/Core/Startup/JwtConfiguration.cs index 307fa34..191a328 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/JwtConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/JwtConfiguration.cs @@ -7,7 +7,7 @@ using Mirea.Api.Security.Common.Interfaces; using System; using System.Text; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class JwtConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/LoggerConfiguration.cs b/Endpoint/Configuration/Core/Startup/LoggerConfiguration.cs similarity index 96% rename from Endpoint/Configuration/ApplicationConfiguration/LoggerConfiguration.cs rename to Endpoint/Configuration/Core/Startup/LoggerConfiguration.cs index 6fc9e3c..aece72b 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/LoggerConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/LoggerConfiguration.cs @@ -2,14 +2,14 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Common.Settings; +using Mirea.Api.Endpoint.Configuration.Model; using Serilog; using Serilog.Events; using Serilog.Filters; using Serilog.Formatting.Compact; using System.IO; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class LoggerConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/SecureConfiguration.cs b/Endpoint/Configuration/Core/Startup/SecureConfiguration.cs similarity index 82% rename from Endpoint/Configuration/ApplicationConfiguration/SecureConfiguration.cs rename to Endpoint/Configuration/Core/Startup/SecureConfiguration.cs index 2b1f853..3452751 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/SecureConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/SecureConfiguration.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Mirea.Api.Endpoint.Common.Services.Security; -using Mirea.Api.Endpoint.Common.Settings; -using Mirea.Api.Endpoint.Configuration.General.Settings; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; +using Mirea.Api.Endpoint.Configuration.Model; using Mirea.Api.Security; using Mirea.Api.Security.Common.Interfaces; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class SecureConfiguration { diff --git a/Endpoint/Configuration/ApplicationConfiguration/SwaggerConfiguration.cs b/Endpoint/Configuration/Core/Startup/SwaggerConfiguration.cs similarity index 97% rename from Endpoint/Configuration/ApplicationConfiguration/SwaggerConfiguration.cs rename to Endpoint/Configuration/Core/Startup/SwaggerConfiguration.cs index 74a0e7f..1fc5b91 100644 --- a/Endpoint/Configuration/ApplicationConfiguration/SwaggerConfiguration.cs +++ b/Endpoint/Configuration/Core/Startup/SwaggerConfiguration.cs @@ -9,7 +9,7 @@ using Swashbuckle.AspNetCore.SwaggerGen; using System; using System.IO; -namespace Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; +namespace Mirea.Api.Endpoint.Configuration.Core.Startup; public static class SwaggerConfiguration { diff --git a/Endpoint/Configuration/General/Interfaces/IIsConfigured.cs b/Endpoint/Configuration/General/Interfaces/IIsConfigured.cs deleted file mode 100644 index 60c09e0..0000000 --- a/Endpoint/Configuration/General/Interfaces/IIsConfigured.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Mirea.Api.Endpoint.Configuration.General.Interfaces; - -public interface IIsConfigured -{ - bool IsConfigured(); -} \ No newline at end of file diff --git a/Endpoint/Common/Settings/ISaveSettings.cs b/Endpoint/Configuration/ISaveSettings.cs similarity index 53% rename from Endpoint/Common/Settings/ISaveSettings.cs rename to Endpoint/Configuration/ISaveSettings.cs index 0b51bde..4b0fd92 100644 --- a/Endpoint/Common/Settings/ISaveSettings.cs +++ b/Endpoint/Configuration/ISaveSettings.cs @@ -1,4 +1,4 @@ -namespace Mirea.Api.Endpoint.Common.Settings; +namespace Mirea.Api.Endpoint.Common.Interfaces; public interface ISaveSettings { void SaveSetting(); diff --git a/Endpoint/Common/Settings/Admin.cs b/Endpoint/Configuration/Model/Admin.cs similarity index 80% rename from Endpoint/Common/Settings/Admin.cs rename to Endpoint/Configuration/Model/Admin.cs index 0e41c36..99f798f 100644 --- a/Endpoint/Common/Settings/Admin.cs +++ b/Endpoint/Configuration/Model/Admin.cs @@ -1,9 +1,10 @@ -using Mirea.Api.Endpoint.Common.Services; +using Mirea.Api.Endpoint.Common.Interfaces; +using Mirea.Api.Endpoint.Common.Services; using System.IO; using System.Text.Json; using System.Text.Json.Serialization; -namespace Mirea.Api.Endpoint.Common.Settings; +namespace Mirea.Api.Endpoint.Configuration.Model; public class Admin : ISaveSettings { diff --git a/Endpoint/Common/Settings/GeneralConfig.cs b/Endpoint/Configuration/Model/GeneralConfig.cs similarity index 79% rename from Endpoint/Common/Settings/GeneralConfig.cs rename to Endpoint/Configuration/Model/GeneralConfig.cs index dcf218e..5674169 100644 --- a/Endpoint/Common/Settings/GeneralConfig.cs +++ b/Endpoint/Configuration/Model/GeneralConfig.cs @@ -1,10 +1,11 @@ -using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Configuration.General.Settings; +using Mirea.Api.Endpoint.Common.Interfaces; +using Mirea.Api.Endpoint.Common.Services; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; using System.IO; using System.Text.Json; using System.Text.Json.Serialization; -namespace Mirea.Api.Endpoint.Common.Settings; +namespace Mirea.Api.Endpoint.Configuration.Model; public class GeneralConfig : ISaveSettings { diff --git a/Endpoint/Configuration/General/Attributes/RequiredSettingsAttribute.cs b/Endpoint/Configuration/Validation/Attributes/RequiredSettingsAttribute.cs similarity index 70% rename from Endpoint/Configuration/General/Attributes/RequiredSettingsAttribute.cs rename to Endpoint/Configuration/Validation/Attributes/RequiredSettingsAttribute.cs index dcb13ac..000a4cb 100644 --- a/Endpoint/Configuration/General/Attributes/RequiredSettingsAttribute.cs +++ b/Endpoint/Configuration/Validation/Attributes/RequiredSettingsAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Mirea.Api.Endpoint.Configuration.General.Attributes; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; [AttributeUsage(AttributeTargets.Class, Inherited = false)] public class RequiredSettingsAttribute : Attribute; diff --git a/Endpoint/Configuration/Validation/Interfaces/IIsConfigured.cs b/Endpoint/Configuration/Validation/Interfaces/IIsConfigured.cs new file mode 100644 index 0000000..1aa1ec9 --- /dev/null +++ b/Endpoint/Configuration/Validation/Interfaces/IIsConfigured.cs @@ -0,0 +1,6 @@ +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; + +public interface IIsConfigured +{ + bool IsConfigured(); +} \ No newline at end of file diff --git a/Endpoint/Configuration/General/Settings/CacheSettings.cs b/Endpoint/Configuration/Validation/Settings/CacheSettings.cs similarity index 64% rename from Endpoint/Configuration/General/Settings/CacheSettings.cs rename to Endpoint/Configuration/Validation/Settings/CacheSettings.cs index a0a7802..cf229ce 100644 --- a/Endpoint/Configuration/General/Settings/CacheSettings.cs +++ b/Endpoint/Configuration/Validation/Settings/CacheSettings.cs @@ -1,7 +1,7 @@ -using Mirea.Api.Endpoint.Configuration.General.Attributes; -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; -namespace Mirea.Api.Endpoint.Configuration.General.Settings; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; [RequiredSettings] public class CacheSettings : IIsConfigured diff --git a/Endpoint/Configuration/General/Settings/DbSettings.cs b/Endpoint/Configuration/Validation/Settings/DbSettings.cs similarity index 79% rename from Endpoint/Configuration/General/Settings/DbSettings.cs rename to Endpoint/Configuration/Validation/Settings/DbSettings.cs index 09eace8..e251eb2 100644 --- a/Endpoint/Configuration/General/Settings/DbSettings.cs +++ b/Endpoint/Configuration/Validation/Settings/DbSettings.cs @@ -1,10 +1,10 @@ using Mirea.Api.DataAccess.Persistence.Common; -using Mirea.Api.Endpoint.Configuration.General.Attributes; -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; using System; using System.Text.Json.Serialization; -namespace Mirea.Api.Endpoint.Configuration.General.Settings; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; [RequiredSettings] public class DbSettings : IIsConfigured diff --git a/Endpoint/Configuration/General/Settings/EmailSettings.cs b/Endpoint/Configuration/Validation/Settings/EmailSettings.cs similarity index 79% rename from Endpoint/Configuration/General/Settings/EmailSettings.cs rename to Endpoint/Configuration/Validation/Settings/EmailSettings.cs index bdd5179..9729e8e 100644 --- a/Endpoint/Configuration/General/Settings/EmailSettings.cs +++ b/Endpoint/Configuration/Validation/Settings/EmailSettings.cs @@ -1,6 +1,6 @@ -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; -namespace Mirea.Api.Endpoint.Configuration.General.Settings; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; public class EmailSettings : IIsConfigured { diff --git a/Endpoint/Configuration/General/Settings/LogSettings.cs b/Endpoint/Configuration/Validation/Settings/LogSettings.cs similarity index 63% rename from Endpoint/Configuration/General/Settings/LogSettings.cs rename to Endpoint/Configuration/Validation/Settings/LogSettings.cs index 4a42d28..9c00d93 100644 --- a/Endpoint/Configuration/General/Settings/LogSettings.cs +++ b/Endpoint/Configuration/Validation/Settings/LogSettings.cs @@ -1,7 +1,7 @@ -using Mirea.Api.Endpoint.Configuration.General.Attributes; -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; -namespace Mirea.Api.Endpoint.Configuration.General.Settings; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; [RequiredSettings] public class LogSettings : IIsConfigured diff --git a/Endpoint/Configuration/General/Settings/ScheduleSettings.cs b/Endpoint/Configuration/Validation/Settings/ScheduleSettings.cs similarity index 82% rename from Endpoint/Configuration/General/Settings/ScheduleSettings.cs rename to Endpoint/Configuration/Validation/Settings/ScheduleSettings.cs index a45b41f..936c4da 100644 --- a/Endpoint/Configuration/General/Settings/ScheduleSettings.cs +++ b/Endpoint/Configuration/Validation/Settings/ScheduleSettings.cs @@ -1,10 +1,10 @@ -using Mirea.Api.Endpoint.Configuration.General.Attributes; -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; using System; using System.Collections.Generic; using System.Linq; -namespace Mirea.Api.Endpoint.Configuration.General.Settings; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; [RequiredSettings] public class ScheduleSettings : IIsConfigured diff --git a/Endpoint/Configuration/General/SetupTokenService.cs b/Endpoint/Configuration/Validation/SetupTokenService.cs similarity index 90% rename from Endpoint/Configuration/General/SetupTokenService.cs rename to Endpoint/Configuration/Validation/SetupTokenService.cs index 4cc1216..58b1ad1 100644 --- a/Endpoint/Configuration/General/SetupTokenService.cs +++ b/Endpoint/Configuration/Validation/SetupTokenService.cs @@ -1,7 +1,7 @@ using Mirea.Api.Endpoint.Common.Interfaces; using System; -namespace Mirea.Api.Endpoint.Configuration.General; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks; public class SetupTokenService : ISetupToken { diff --git a/Endpoint/Configuration/General/Validators/SettingsRequiredValidator.cs b/Endpoint/Configuration/Validation/Validators/SettingsRequiredValidator.cs similarity index 79% rename from Endpoint/Configuration/General/Validators/SettingsRequiredValidator.cs rename to Endpoint/Configuration/Validation/Validators/SettingsRequiredValidator.cs index 323ea7c..8ab315f 100644 --- a/Endpoint/Configuration/General/Validators/SettingsRequiredValidator.cs +++ b/Endpoint/Configuration/Validation/Validators/SettingsRequiredValidator.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Options; -using Mirea.Api.Endpoint.Common.Settings; -using Mirea.Api.Endpoint.Configuration.General.Attributes; -using Mirea.Api.Endpoint.Configuration.General.Interfaces; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Attributes; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Interfaces; +using Mirea.Api.Endpoint.Configuration.Model; using System; using System.Reflection; -namespace Mirea.Api.Endpoint.Configuration.General.Validators; +namespace Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Validators; public class SettingsRequiredValidator { diff --git a/Endpoint/Controllers/Configuration/SetupController.cs b/Endpoint/Controllers/Configuration/SetupController.cs index a0beff6..68fbd3d 100644 --- a/Endpoint/Controllers/Configuration/SetupController.cs +++ b/Endpoint/Controllers/Configuration/SetupController.cs @@ -10,9 +10,9 @@ using Mirea.Api.Endpoint.Common.Attributes; using Mirea.Api.Endpoint.Common.Exceptions; using Mirea.Api.Endpoint.Common.Interfaces; using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Common.Settings; -using Mirea.Api.Endpoint.Configuration.General.Settings; -using Mirea.Api.Endpoint.Configuration.General.Validators; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Settings; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Validators; +using Mirea.Api.Endpoint.Configuration.Model; using Mirea.Api.Security.Services; using MySqlConnector; using Npgsql; @@ -29,7 +29,6 @@ using System.Security.Cryptography; namespace Mirea.Api.Endpoint.Controllers.Configuration; [ApiVersion("1.0")] -[ApiController] [MaintenanceModeIgnore] [ApiExplorerSettings(IgnoreApi = true)] public class SetupController( diff --git a/Endpoint/Controllers/V1/AuthController.cs b/Endpoint/Controllers/V1/AuthController.cs index e07868a..81f0fdb 100644 --- a/Endpoint/Controllers/V1/AuthController.cs +++ b/Endpoint/Controllers/V1/AuthController.cs @@ -10,7 +10,7 @@ using Mirea.Api.Dto.Responses; using Mirea.Api.Endpoint.Common.Attributes; using Mirea.Api.Endpoint.Common.Exceptions; using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Common.Settings; +using Mirea.Api.Endpoint.Configuration.Model; using Mirea.Api.Security.Common.Dto.Requests; using Mirea.Api.Security.Services; using System; diff --git a/Endpoint/Controllers/V1/ScheduleController.cs b/Endpoint/Controllers/V1/ScheduleController.cs index 2167309..bcac4d2 100644 --- a/Endpoint/Controllers/V1/ScheduleController.cs +++ b/Endpoint/Controllers/V1/ScheduleController.cs @@ -9,7 +9,7 @@ using Mirea.Api.Dto.Requests; using Mirea.Api.Dto.Responses; using Mirea.Api.Endpoint.Common.Attributes; using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Common.Settings; +using Mirea.Api.Endpoint.Configuration.Model; using System; using System.Collections.Generic; using System.Linq; diff --git a/Endpoint/Program.cs b/Endpoint/Program.cs index 90d4844..f038d3c 100644 --- a/Endpoint/Program.cs +++ b/Endpoint/Program.cs @@ -10,10 +10,10 @@ using Mirea.Api.DataAccess.Persistence; using Mirea.Api.DataAccess.Persistence.Common; using Mirea.Api.Endpoint.Common.Interfaces; using Mirea.Api.Endpoint.Common.Services; -using Mirea.Api.Endpoint.Common.Settings; -using Mirea.Api.Endpoint.Configuration.ApplicationConfiguration; -using Mirea.Api.Endpoint.Configuration.General; -using Mirea.Api.Endpoint.Configuration.General.Validators; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks; +using Mirea.Api.Endpoint.Configuration.ConfigurationChecks.Validators; +using Mirea.Api.Endpoint.Configuration.Core.Startup; +using Mirea.Api.Endpoint.Configuration.Model; using Mirea.Api.Endpoint.Middleware; using Mirea.Api.Security.Services; using System;