mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
add loader and versioning
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Azaion.CommonSecurity.DTO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Azaion.CommonSecurity;
|
||||
|
||||
@@ -56,4 +57,22 @@ public class SecurityConstants
|
||||
}
|
||||
};
|
||||
#endregion ExternalClientsConfig
|
||||
|
||||
public static InitConfig ReadInitConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(CONFIG_PATH))
|
||||
throw new FileNotFoundException(CONFIG_PATH);
|
||||
var configStr = File.ReadAllText(CONFIG_PATH);
|
||||
var config = JsonConvert.DeserializeObject<InitConfig>(configStr);
|
||||
|
||||
return config ?? DefaultInitConfig;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
return DefaultInitConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user