refactor:重构配置热加载

This commit is contained in:
jxxghp
2025-06-03 20:56:21 +08:00
parent 5f18a21e86
commit b4ed2880f7
18 changed files with 291 additions and 80 deletions

View File

@@ -2,6 +2,7 @@ import copy
import xml.dom.minidom
from typing import Optional, Union, List, Tuple, Any, Dict
from app.core.config import on_config_change
from app.core.context import Context, MediaInfo
from app.core.event import eventmanager
from app.log import logger
@@ -9,13 +10,14 @@ from app.modules import _ModuleBase, _MessageBase
from app.modules.wechat.WXBizMsgCrypt3 import WXBizMsgCrypt
from app.modules.wechat.wechat import WeChat
from app.schemas import MessageChannel, CommingMessage, Notification, CommandRegisterEventData
from app.schemas.types import ModuleType, ChainEventType
from app.schemas.types import ModuleType, ChainEventType, SystemConfigKey
from app.utils.dom import DomUtils
from app.utils.structures import DictUtils
class WechatModule(_ModuleBase, _MessageBase[WeChat]):
@on_config_change([SystemConfigKey.Notifications.value])
def init_module(self) -> None:
"""
初始化模块