diff --git a/MilimoeWebAPI/MilimoeWebAPI.cs b/MilimoeWebAPI/MilimoeWebAPI.cs index 71c33b3..e0043bd 100644 --- a/MilimoeWebAPI/MilimoeWebAPI.cs +++ b/MilimoeWebAPI/MilimoeWebAPI.cs @@ -34,20 +34,12 @@ namespace Milimoe.FunGame.WebAPI public override void AfterLoad(WebAPIPluginLoader loader, params object[] objs) { + Configs.Load(); + Configs.Save(); Statics.RunningPlugin ??= this; Statics.WebAPIPluginLoader ??= loader; Controller.NewSQLHelper(); Controller.NewMailSender(); - if (objs.Length > 0 && objs[0] is WebApplicationBuilder builder) - { - builder.Services.AddTransient(provider => - { - SQLHelper? sql = Factory.OpenFactory.GetSQLHelper(); - if (sql != null) return sql; - throw new SQLServiceException(); - }); - builder.Services.AddTransient(); - } WebAPIAuthenticator.WebAPICustomBearerTokenAuthenticator += CustomBearerTokenAuthenticator; } diff --git a/MilimoeWebAPI/Scripts/saints.sql b/MilimoeWebAPI/Scripts/saints.sql new file mode 100644 index 0000000..489d976 --- /dev/null +++ b/MilimoeWebAPI/Scripts/saints.sql @@ -0,0 +1,14 @@ +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `saints`; +CREATE TABLE `saints` ( + `UID` bigint NOT NULL DEFAULT '0', + `Group` bigint NOT NULL DEFAULT '0', + `Year` int NOT NULL DEFAULT '0', + `Month` int NOT NULL DEFAULT '0', + `Times` int DEFAULT '0', + `SC` double(20,2) DEFAULT '0.00', + `Remark` varchar(255) DEFAULT '', + `Record` varchar(1000) CHARACTER SET utf8mb4 DEFAULT '', + PRIMARY KEY (`UID`,`Group`,`Year`,`Month`) +);