feat(plugin): P1-P4 审计修复 — 第三批 (配置变更通知 + 自定义视图)
3.1 配置变更通知:
- update_config 增加 EventBus 参数
- 更新成功后发布 plugin.config.updated 事件
- handler 传入 event_bus
3.2 自定义视图:
- plugin_user_views 表迁移 (id/tenant_id/user_id/plugin_id/entity/view_name/view_config/is_default)
- CRUD API: GET/POST /plugins/{id}/{entity}/views, DELETE /plugins/{id}/{entity}/views/{view_id}
- 默认视图互斥逻辑
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::Router;
|
||||
use axum::routing::{get, post, put};
|
||||
use axum::routing::{delete, get, post, put};
|
||||
use erp_core::module::ErpModule;
|
||||
|
||||
pub struct PluginModule;
|
||||
@@ -131,6 +131,16 @@ impl PluginModule {
|
||||
.route(
|
||||
"/plugins/{plugin_id}/reconcile",
|
||||
post(crate::handler::data_handler::reconcile_refs::<S>),
|
||||
)
|
||||
// 用户自定义视图
|
||||
.route(
|
||||
"/plugins/{plugin_id}/{entity}/views",
|
||||
get(crate::handler::data_handler::list_user_views::<S>)
|
||||
.post(crate::handler::data_handler::create_user_view::<S>),
|
||||
)
|
||||
.route(
|
||||
"/plugins/{plugin_id}/{entity}/views/{view_id}",
|
||||
delete(crate::handler::data_handler::delete_user_view::<S>),
|
||||
);
|
||||
|
||||
// 实体注册表路由
|
||||
|
||||
Reference in New Issue
Block a user