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:
@@ -305,3 +305,26 @@ pub struct DanglingRef {
|
||||
/// 悬空的 UUID 值
|
||||
pub dangling_value: String,
|
||||
}
|
||||
|
||||
// ─── 自定义视图 DTO ──────────────────────────────────────────────────
|
||||
|
||||
/// 用户视图配置请求
|
||||
#[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)]
|
||||
pub struct UserViewReq {
|
||||
pub view_name: String,
|
||||
pub view_config: serde_json::Value,
|
||||
pub is_default: Option<bool>,
|
||||
}
|
||||
|
||||
/// 用户视图响应
|
||||
#[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)]
|
||||
pub struct UserViewResp {
|
||||
pub id: String,
|
||||
pub plugin_id: String,
|
||||
pub entity_name: String,
|
||||
pub view_name: String,
|
||||
pub view_config: serde_json::Value,
|
||||
pub is_default: bool,
|
||||
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
|
||||
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user