feat(plugin): P1-P4 审计修复 — 第一批 (Excel/CSV导出 + 市场API + 对账扫描)
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

1.1 Excel/CSV 导出:
- 后端 export 支持 format 参数 (json/csv/xlsx)
- rust_xlsxwriter 生成带样式 Excel
- 前端导出按钮改为 Dropdown 格式选择 (JSON/CSV/Excel)
- blob 下载支持 CSV/XLSX 二进制格式

1.2 市场后端 API + 前端对接:
- SeaORM Entity: market_entry, market_review
- API: 浏览/详情/一键安装/评论列表/提交评分
- 一键安装: upload → install → enable 一条龙 + 依赖检查
- 前端 PluginMarket 对接真实 API (搜索/分类/安装/评分)

1.3 对账扫描:
- reconcile_references() 扫描跨插件引用悬空 UUID
- POST /plugins/{plugin_id}/reconcile 端点
This commit is contained in:
iven
2026-04-19 14:32:06 +08:00
parent 120f3fe867
commit 4bcb4beaa5
16 changed files with 1243 additions and 151 deletions

View File

@@ -122,6 +122,11 @@ impl PluginModule {
.route(
"/plugins/{plugin_id}/{entity}/import",
post(crate::handler::data_handler::import_plugin_data::<S>),
)
// 对账扫描
.route(
"/plugins/{plugin_id}/reconcile",
post(crate::handler::data_handler::reconcile_refs::<S>),
);
// 实体注册表路由
@@ -131,6 +136,26 @@ impl PluginModule {
get(crate::handler::data_handler::list_public_entities::<S>),
);
admin_routes.merge(data_routes).merge(registry_routes)
// 市场路由
let market_routes = Router::new()
.route(
"/market/entries",
get(crate::handler::market_handler::list_market_entries::<S>),
)
.route(
"/market/entries/{id}",
get(crate::handler::market_handler::get_market_entry::<S>),
)
.route(
"/market/entries/{id}/install",
post(crate::handler::market_handler::install_from_market::<S>),
)
.route(
"/market/entries/{id}/reviews",
get(crate::handler::market_handler::list_market_reviews::<S>)
.post(crate::handler::market_handler::submit_market_review::<S>),
);
admin_routes.merge(data_routes).merge(registry_routes).merge(market_routes)
}
}