This commit is contained in:
milimoe 2025-12-31 21:17:25 +08:00
parent cdf3fad718
commit f752287bed
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 16 additions and 10 deletions

View File

@ -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<JsonTool>();
}
WebAPIAuthenticator.WebAPICustomBearerTokenAuthenticator += CustomBearerTokenAuthenticator;
}

View File

@ -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`)
);