Configure ASP.NET for the API to work #7
36
Endpoint/Properties/Settings.cs
Normal file
36
Endpoint/Properties/Settings.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using Mirea.Api.DataAccess.Persistence.Properties;
|
||||||
|
|
||||||
|
namespace Mirea.Api.Endpoint.Properties;
|
||||||
|
|
||||||
|
public class EmailSettings
|
||||||
|
{
|
||||||
|
public string? Server { get; set; }
|
||||||
|
public string? User { get; set; }
|
||||||
|
public string? Password { get; set; }
|
||||||
|
public string? From { get; set; }
|
||||||
|
public int? Port { get; set; }
|
||||||
|
public bool? Ssl { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LogSettings
|
||||||
|
{
|
||||||
|
public bool EnableLogToFile { get; set; }
|
||||||
|
public string? LogFilePath { get; set; }
|
||||||
|
public string? LogFileName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScheduleSettings
|
||||||
|
{
|
||||||
|
// Every 6 hours
|
||||||
|
public string CronUpdateSchedule { get; set; } = "0 0 0/6 * * *";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Settings
|
||||||
|
{
|
||||||
|
public const string FilePath = "Settings.json";
|
||||||
|
|
||||||
|
public EmailSettings? EmailSettings { get; set; }
|
||||||
|
public LogSettings? LogSettings { get; set; }
|
||||||
|
public DbSettings? DbSettings { get; set; }
|
||||||
|
public ScheduleSettings? ScheduleSettings { get; set; }
|
||||||
|
}
|
15
Persistence/Properties/DbSettings.cs
Normal file
15
Persistence/Properties/DbSettings.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace Mirea.Api.DataAccess.Persistence.Properties;
|
||||||
|
|
||||||
|
public enum DatabaseEnum
|
||||||
|
{
|
||||||
|
Mysql,
|
||||||
|
Sqlite,
|
||||||
|
PostgresSql
|
||||||
|
}
|
||||||
|
public class DbSettings
|
||||||
|
{
|
||||||
|
public bool IsDoneConfiguration { get; set; }
|
||||||
|
public DatabaseEnum TypeDatabase { get; set; }
|
||||||
|
public required string ConnectionStringSql { get; set; }
|
||||||
|
public DatabaseEnum? MigrateTo { get; set; }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user