25 lines
588 B
Python
25 lines
588 B
Python
# ///
|
|
# sample_plugin.py
|
|
# 描述:示例自定义插件
|
|
# ///
|
|
|
|
from plugins.base import PluginBase, PluginType
|
|
|
|
class SamplePlugin(PluginBase):
|
|
plugin_name = "sample_plugin"
|
|
plugin_version = "1.0.0"
|
|
plugin_type = PluginType.CUSTOM
|
|
plugin_description = "示例自定义插件"
|
|
plugin_author = "User"
|
|
|
|
def initialize(self, config) -> bool:
|
|
self.config = config
|
|
return True
|
|
|
|
def execute(self, params) -> dict:
|
|
return {
|
|
"success": True,
|
|
"message": "Sample plugin executed!",
|
|
"params": params
|
|
}
|