提交功能
This commit is contained in:
51
App.cs
Normal file
51
App.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ACBuildService;
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static bool Running { get; set; }
|
||||
public static AppSettingsConfigs Settings = new AppSettingsConfigs();
|
||||
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
Running = true;
|
||||
LoadSetting();
|
||||
DB.InitDb();
|
||||
}
|
||||
|
||||
public static void LoadSetting()
|
||||
{
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.Build();
|
||||
|
||||
var config = configuration.Get<AppSettingsConfigs>(); //绑定到实体
|
||||
if (config != null)
|
||||
{
|
||||
Settings = config;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IOException("配置文件读取失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Update
|
||||
|
||||
internal static void Update()
|
||||
{
|
||||
Time.Update();
|
||||
}
|
||||
|
||||
internal static void LateUpdate()
|
||||
{
|
||||
Time.LateUpdate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user