Release v1.0.0 #16
.envnuget.config
.gitea/workflows
.gitignoreApiDto
ApiDto.csproj
Backend.slnDockerfileCommon
Requests
Responses
Endpoint
Backend.http
Common
Attributes
BadRequestResponseAttribute.csLocalhostAttribute.csMaintenanceModeIgnoreAttribute.csNotFoundResponseAttribute.csSwaggerDefaultAttribute.csTokenAuthenticationAttribute.cs
Exceptions
Interfaces
Services
MaintenanceModeNotConfigureService.csMaintenanceModeService.csPairPeriodTimeConverter.csPathBuilder.cs
Security
Settings
Configuration
AppConfig
ApiVersioningConfiguration.csCacheConfiguration.csEnvironmentConfiguration.csJwtConfiguration.csLoggerConfiguration.csSecureConfiguration.csSwaggerConfiguration.cs
General
Swagger
Controllers
BaseController.cs
Endpoint.csprojConfiguration
V1
AuthController.csCampusController.csDisciplineController.csFacultyController.csGroupController.csLectureHallController.csProfessorController.csScheduleController.cs
WeatherForecastController.csMiddleware
Program.csWeatherForecast.cswwwroot/css/swagger
Security
SqlData
Application
Application.csprojDependencyInjection.cs
Common
Cqrs
Campus/Queries
GetCampusBasicInfoList
CampusBasicInfoDto.csCampusBasicInfoVm.csGetCampusBasicInfoListQuery.csGetCampusBasicInfoListQueryHandler.cs
GetCampusDetails
Discipline/Queries
GetDisciplineDetails
GetDisciplineList
Faculty/Queries
GetFacultyDetails
GetFacultyList
Group/Queries
GetGroupDetails
GetGroupList
LectureHall/Queries
GetLectureHallDetails
GetLectureHallList
Professor/Queries
GetProfessorDetails
GetProfessorList
Schedule/Queries/GetScheduleList
Interfaces/DbContexts
Domain
Domain.csproj
Schedule
Migrations
MysqlMigrations
Migrations
20240601023106_InitialMigration.Designer.cs20240601023106_InitialMigration.csUberDbContextModelSnapshot.cs
MysqlMigrations.csprojPsqlMigrations
Migrations
20240601021702_InitialMigration.Designer.cs20240601021702_InitialMigration.csUberDbContextModelSnapshot.cs
PsqlMigrations.csprojSqliteMigrations
Persistence
Common
BaseDbContext.csConfigurationResolver.csDatabaseProvider.csDbContextFactory.csModelBuilderExtensions.cs
Contexts/Schedule
CampusDbContext.csDisciplineDbContext.csFacultyDbContext.csGroupDbContext.csLectureHallDbContext.csLessonAssociationDbContext.csLessonDbContext.csProfessorDbContext.csSpecificWeekDbContext.csTypeOfOccupationDbContext.cs
DbInitializer.csDependencyInjection.csEntityTypeConfigurations
Mark.cs
Persistence.csprojUberDbContext.csMysql/Schedule
CampusConfiguration.csDisciplineConfiguration.csFacultyConfiguration.csGroupConfiguration.csLectureHallConfiguration.csLessonAssociationConfiguration.csLessonConfiguration.csProfessorConfiguration.csSpecificWeekConfiguration.csTypeOfOccupationConfiguration.cs
Postgresql/Schedule
CampusConfiguration.csDisciplineConfiguration.csFacultyConfiguration.csGroupConfiguration.csLectureHallConfiguration.csLessonAssociationConfiguration.csLessonConfiguration.csProfessorConfiguration.csSpecificWeekConfiguration.csTypeOfOccupationConfiguration.cs
Sqlite/Schedule
@ -4,9 +4,9 @@ using System.IO;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Mirea.Api.Endpoint.Configuration.General;
|
namespace Mirea.Api.Endpoint.Common.Settings;
|
||||||
|
|
||||||
public class GeneralConfig
|
public class GeneralConfig : ISaveSettings
|
||||||
{
|
{
|
||||||
[JsonIgnore] private const string FileName = "Settings.json";
|
[JsonIgnore] private const string FileName = "Settings.json";
|
||||||
|
|
5
Endpoint/Common/Settings/ISaveSettings.cs
Normal file
5
Endpoint/Common/Settings/ISaveSettings.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
namespace Mirea.Api.Endpoint.Common.Settings;
|
||||||
|
public interface ISaveSettings
|
||||||
|
{
|
||||||
|
void SaveSetting();
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
||||||
|
|
||||||
namespace Mirea.Api.Endpoint.Configuration.AppConfig;
|
namespace Mirea.Api.Endpoint.Configuration.AppConfig;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Mirea.Api.Endpoint.Common.Services;
|
using Mirea.Api.Endpoint.Common.Services;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Serilog.Filters;
|
using Serilog.Filters;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Mirea.Api.Endpoint.Common.Services.Security;
|
using Mirea.Api.Endpoint.Common.Services.Security;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
||||||
using Mirea.Api.Security;
|
using Mirea.Api.Security;
|
||||||
using Mirea.Api.Security.Common.Interfaces;
|
using Mirea.Api.Security.Common.Interfaces;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Attributes;
|
using Mirea.Api.Endpoint.Configuration.General.Attributes;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Interfaces;
|
using Mirea.Api.Endpoint.Configuration.General.Interfaces;
|
||||||
using System;
|
using System;
|
||||||
|
@ -8,9 +8,8 @@ using Mirea.Api.Dto.Requests.Configuration;
|
|||||||
using Mirea.Api.Endpoint.Common.Attributes;
|
using Mirea.Api.Endpoint.Common.Attributes;
|
||||||
using Mirea.Api.Endpoint.Common.Exceptions;
|
using Mirea.Api.Endpoint.Common.Exceptions;
|
||||||
using Mirea.Api.Endpoint.Common.Interfaces;
|
using Mirea.Api.Endpoint.Common.Interfaces;
|
||||||
using Mirea.Api.Endpoint.Common.Model;
|
|
||||||
using Mirea.Api.Endpoint.Common.Services;
|
using Mirea.Api.Endpoint.Common.Services;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
using Mirea.Api.Endpoint.Configuration.General.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Validators;
|
using Mirea.Api.Endpoint.Configuration.General.Validators;
|
||||||
using Mirea.Api.Security.Services;
|
using Mirea.Api.Security.Services;
|
||||||
@ -24,7 +23,6 @@ using System.IO;
|
|||||||
using System.Net.Mail;
|
using System.Net.Mail;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Mirea.Api.Endpoint.Controllers.Configuration;
|
namespace Mirea.Api.Endpoint.Controllers.Configuration;
|
||||||
@ -333,8 +331,7 @@ public partial class SetupController(
|
|||||||
if (!cache.TryGetValue(CacheAdminKey, out Admin? admin) || admin == null)
|
if (!cache.TryGetValue(CacheAdminKey, out Admin? admin) || admin == null)
|
||||||
throw new ControllerArgumentException("The administrator's data was not set.");
|
throw new ControllerArgumentException("The administrator's data was not set.");
|
||||||
|
|
||||||
System.IO.File.WriteAllText(PathBuilder.Combine(Admin.PathToSave), JsonSerializer.Serialize(admin));
|
admin.SaveSetting();
|
||||||
|
|
||||||
GeneralConfig.SaveSetting();
|
GeneralConfig.SaveSetting();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -6,7 +6,7 @@ using Microsoft.Extensions.Options;
|
|||||||
using Mirea.Api.Dto.Common;
|
using Mirea.Api.Dto.Common;
|
||||||
using Mirea.Api.Dto.Requests;
|
using Mirea.Api.Dto.Requests;
|
||||||
using Mirea.Api.Dto.Responses;
|
using Mirea.Api.Dto.Responses;
|
||||||
using Mirea.Api.Endpoint.Common.Model;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Security.Common.Dto.Requests;
|
using Mirea.Api.Security.Common.Dto.Requests;
|
||||||
using Mirea.Api.Security.Services;
|
using Mirea.Api.Security.Services;
|
||||||
using System;
|
using System;
|
||||||
|
@ -8,7 +8,7 @@ using Mirea.Api.Dto.Requests;
|
|||||||
using Mirea.Api.Dto.Responses;
|
using Mirea.Api.Dto.Responses;
|
||||||
using Mirea.Api.Endpoint.Common.Attributes;
|
using Mirea.Api.Endpoint.Common.Attributes;
|
||||||
using Mirea.Api.Endpoint.Common.Services;
|
using Mirea.Api.Endpoint.Common.Services;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -7,8 +7,8 @@ using Mirea.Api.DataAccess.Application;
|
|||||||
using Mirea.Api.DataAccess.Persistence;
|
using Mirea.Api.DataAccess.Persistence;
|
||||||
using Mirea.Api.DataAccess.Persistence.Common;
|
using Mirea.Api.DataAccess.Persistence.Common;
|
||||||
using Mirea.Api.Endpoint.Common.Interfaces;
|
using Mirea.Api.Endpoint.Common.Interfaces;
|
||||||
using Mirea.Api.Endpoint.Common.Model;
|
|
||||||
using Mirea.Api.Endpoint.Common.Services;
|
using Mirea.Api.Endpoint.Common.Services;
|
||||||
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Endpoint.Configuration.AppConfig;
|
using Mirea.Api.Endpoint.Configuration.AppConfig;
|
||||||
using Mirea.Api.Endpoint.Configuration.General;
|
using Mirea.Api.Endpoint.Configuration.General;
|
||||||
using Mirea.Api.Endpoint.Configuration.General.Validators;
|
using Mirea.Api.Endpoint.Configuration.General.Validators;
|
||||||
@ -40,7 +40,7 @@ public class Program
|
|||||||
builder.Configuration.AddConfiguration(EnvironmentConfiguration.GetEnvironment());
|
builder.Configuration.AddConfiguration(EnvironmentConfiguration.GetEnvironment());
|
||||||
builder.Configuration.AddJsonFile(GeneralConfig.FilePath, optional: true, reloadOnChange: true);
|
builder.Configuration.AddJsonFile(GeneralConfig.FilePath, optional: true, reloadOnChange: true);
|
||||||
builder.Services.Configure<GeneralConfig>(builder.Configuration);
|
builder.Services.Configure<GeneralConfig>(builder.Configuration);
|
||||||
builder.Configuration.AddJsonFile(PathBuilder.Combine(Admin.PathToSave), optional: true, reloadOnChange: true);
|
builder.Configuration.AddJsonFile(Admin.FilePath, optional: true, reloadOnChange: true);
|
||||||
builder.Services.Configure<Admin>(builder.Configuration);
|
builder.Services.Configure<Admin>(builder.Configuration);
|
||||||
|
|
||||||
builder.Host.AddCustomSerilog();
|
builder.Host.AddCustomSerilog();
|
||||||
|
Reference in New Issue
Block a user