✨ 重构插件商店,支持Gitee插件管理,更新相关逻辑和配置 (#1931)

This commit is contained in:
xuanerwa
2025-06-20 19:08:06 +08:00
committed by GitHub
parent 6298685e09
commit 14f5842f10
20 changed files with 472 additions and 173 deletions
@@ -359,7 +359,7 @@ async def test_add_plugin_exist(
init_mocked_api(mocked_api=mocked_api)
mocker.patch(
"zhenxun.builtin_plugins.plugin_store.data_source.ShopManage.get_loaded_plugins",
"zhenxun.builtin_plugins.plugin_store.data_source.StoreManager.get_loaded_plugins",
return_value=[("search_image", "0.1")],
)
plugin_id = 1
@@ -57,7 +57,7 @@ async def test_search_plugin_name(
)
ctx.receive_event(bot=bot, event=event)
mock_table_page.assert_awaited_once_with(
"插件列表",
"商店插件列表",
"通过添加/移除插件 ID 来管理插件",
["-", "ID", "名称", "简介", "作者", "版本", "类型"],
[
@@ -123,7 +123,7 @@ async def test_search_plugin_author(
)
ctx.receive_event(bot=bot, event=event)
mock_table_page.assert_awaited_once_with(
"插件列表",
"商店插件列表",
"通过添加/移除插件 ID 来管理插件",
["-", "ID", "名称", "简介", "作者", "版本", "类型"],
[
@@ -32,7 +32,7 @@ async def test_update_all_plugin_basic_need_update(
new=tmp_path / "zhenxun",
)
mocker.patch(
"zhenxun.builtin_plugins.plugin_store.data_source.ShopManage.get_loaded_plugins",
"zhenxun.builtin_plugins.plugin_store.data_source.StoreManager.get_loaded_plugins",
return_value=[("search_image", "0.0")],
)
@@ -87,7 +87,7 @@ async def test_update_all_plugin_basic_is_new(
new=tmp_path / "zhenxun",
)
mocker.patch(
"zhenxun.builtin_plugins.plugin_store.data_source.ShopManage.get_loaded_plugins",
"zhenxun.builtin_plugins.plugin_store.data_source.StoreManager.get_loaded_plugins",
return_value=[("search_image", "0.1")],
)
@@ -32,7 +32,7 @@ async def test_update_plugin_basic_need_update(
new=tmp_path / "zhenxun",
)
mocker.patch(
"zhenxun.builtin_plugins.plugin_store.data_source.ShopManage.get_loaded_plugins",
"zhenxun.builtin_plugins.plugin_store.data_source.StoreManager.get_loaded_plugins",
return_value=[("search_image", "0.0")],
)
@@ -87,7 +87,7 @@ async def test_update_plugin_basic_is_new(
new=tmp_path / "zhenxun",
)
mocker.patch(
"zhenxun.builtin_plugins.plugin_store.data_source.ShopManage.get_loaded_plugins",
"zhenxun.builtin_plugins.plugin_store.data_source.StoreManager.get_loaded_plugins",
return_value=[("search_image", "0.1")],
)
+10 -6
View File
@@ -1,5 +1,6 @@
{
"鸡汤": {
[
{
"name": "鸡汤",
"module": "jitang",
"module_path": "plugins.alapi.jitang",
"description": "喏,亲手为你煮的鸡汤",
@@ -9,7 +10,8 @@
"plugin_type": "NORMAL",
"is_dir": false
},
"识图": {
{
"name": "识图",
"module": "search_image",
"module_path": "plugins.search_image",
"description": "以图搜图,看破本源",
@@ -19,7 +21,8 @@
"plugin_type": "NORMAL",
"is_dir": true
},
"网易云热评": {
{
"name": "网易云热评",
"module": "comments_163",
"module_path": "plugins.alapi.comments_163",
"description": "生了个人,我很抱歉",
@@ -29,7 +32,8 @@
"plugin_type": "NORMAL",
"is_dir": false
},
"B站订阅": {
{
"name": "B站订阅",
"module": "bilibili_sub",
"module_path": "plugins.bilibili_sub",
"description": "非常便利的B站订阅通知",
@@ -39,4 +43,4 @@
"plugin_type": "NORMAL",
"is_dir": true
}
}
]
@@ -1,5 +1,6 @@
{
"github订阅": {
[
{
"name": "github订阅",
"module": "github_sub",
"module_path": "github_sub",
"description": "订阅github用户或仓库",
@@ -10,7 +11,8 @@
"is_dir": true,
"github_url": "https://github.com/xuanerwa/zhenxun_github_sub"
},
"Minecraft查服": {
{
"name": "Minecraft查服",
"module": "mc_check",
"module_path": "mc_check",
"description": "Minecraft服务器状态查询,支持IPv6",
@@ -21,4 +23,4 @@
"is_dir": true,
"github_url": "https://github.com/molanp/zhenxun_check_Minecraft"
}
}
]