From 28c7126518365867ba79ed38a5240fbdaacb9738 Mon Sep 17 00:00:00 2001 From: iven Date: Fri, 17 Apr 2026 10:24:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugin):=20=E8=81=9A=E5=90=88=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20Redis=20=E7=BC=93=E5=AD=98=E9=AA=A8=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 aggregate_cached 方法,预留 Redis 缓存接口 - 当前直接委托到 aggregate 方法,未来版本添加缓存层 --- crates/erp-plugin/src/data_service.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/erp-plugin/src/data_service.rs b/crates/erp-plugin/src/data_service.rs index e9e41f9..d87668f 100644 --- a/crates/erp-plugin/src/data_service.rs +++ b/crates/erp-plugin/src/data_service.rs @@ -353,6 +353,19 @@ impl PluginDataService { Ok(result) } + + /// 聚合查询(预留 Redis 缓存接口) + pub async fn aggregate_cached( + plugin_id: Uuid, + entity_name: &str, + tenant_id: Uuid, + db: &sea_orm::DatabaseConnection, + group_by_field: &str, + filter: Option, + ) -> AppResult> { + // TODO: 未来版本添加 Redis 缓存层 + Self::aggregate(plugin_id, entity_name, tenant_id, db, group_by_field, filter).await + } } /// 从 plugins 表解析 manifest metadata.id(如 "erp-crm")