修改ProjectConfig生成来源

This commit is contained in:
2025-11-07 23:48:10 +08:00
parent 4d5154a2ac
commit a676533510
4 changed files with 21 additions and 19 deletions

View File

@@ -9,8 +9,9 @@ from PWF.CoreModules.plugin_interface import DatabaseModel, get_db
from .WPSAPI import WPSAPI
config = ProjectConfig()
CHECKIN_POINTS = config.FindItem("checkin_points", 100)
logger = ProjectConfig()
CHECKIN_POINTS = logger.FindItem("checkin_points", 100)
logger.SaveProperties()
class WPSConfigAPI(WPSAPI):
@override
@@ -35,7 +36,7 @@ class WPSConfigAPI(WPSAPI):
@override
def wake_up(self) -> None:
config.Log("Info", f"{ConsoleFrontColor.GREEN}WPSConfigAPI 插件已加载{ConsoleFrontColor.RESET}")
logger.Log("Info", f"{ConsoleFrontColor.GREEN}WPSConfigAPI 插件已加载{ConsoleFrontColor.RESET}")
self.register_plugin("config")
self.register_plugin("cfg")
@@ -201,7 +202,7 @@ class WPSCheckinAPI(WPSAPI):
@override
def wake_up(self) -> None:
config.Log("Info", f"{ConsoleFrontColor.GREEN}WPSCheckinAPI 插件已加载{ConsoleFrontColor.RESET}")
logger.Log("Info", f"{ConsoleFrontColor.GREEN}WPSCheckinAPI 插件已加载{ConsoleFrontColor.RESET}")
self.register_plugin("checkin")
self.register_plugin("签到")
@@ -262,7 +263,5 @@ class WPSCheckinAPI(WPSAPI):
- 今日签到状态: {"已签到" if self._get_today_checkin_status(user_id) else "未签到"}
'''
config.SaveProperties()
__all__ = ["WPSConfigAPI"]