临时调整权限模块,备份
This commit is contained in:
@@ -13,6 +13,18 @@ from db.connection import DBConnectionManager
|
||||
class StatsCollectorPlugin(PluginInterface):
|
||||
"""统计收集插件"""
|
||||
|
||||
# 功能权限常量
|
||||
FEATURE_KEY = "STATS_COLLECTOR"
|
||||
FEATURE_DESCRIPTION = "📊 指令记录功能 [自动记录指令使用情况]"
|
||||
|
||||
@property
|
||||
def feature_key(self) -> Optional[str]:
|
||||
return self.FEATURE_KEY
|
||||
|
||||
@property
|
||||
def feature_description(self) -> Optional[str]:
|
||||
return self.FEATURE_DESCRIPTION
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return "指令记录"
|
||||
@@ -38,10 +50,8 @@ class StatsCollectorPlugin(PluginInterface):
|
||||
return []
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super().__init__()
|
||||
self.LOG = logger
|
||||
|
||||
self.LOG.info(f"正在初始化 {self.name} 插件...")
|
||||
# 默认配置
|
||||
self.config = {
|
||||
@@ -49,10 +59,11 @@ class StatsCollectorPlugin(PluginInterface):
|
||||
"record_all_plugins": True, # 是否记录所有插件的调用
|
||||
"excluded_plugins": [], # 排除的插件列表
|
||||
}
|
||||
|
||||
self.event_manager = EventManager.get_instance()
|
||||
self.db_manager = DBConnectionManager.get_instance()
|
||||
self.stats_db = StatsDBOperator(self.db_manager)
|
||||
# 注册功能权限
|
||||
self.feature = self.register_feature()
|
||||
|
||||
def initialize(self, config: Dict[str, Any]) -> bool:
|
||||
"""初始化插件"""
|
||||
|
||||
Reference in New Issue
Block a user