feat(plugin): Schema 缓存 — moka LRU Cache 消除 resolve_entity_info 重复查库

- 添加 moka 0.12 依赖到 erp-plugin 和 erp-server
- 重写 state.rs: 新增 EntityInfo (含 generated_fields) 和 moka Cache
- AppState 新增 plugin_entity_cache 字段
- data_service.rs: 旧 resolve_entity_info 保留兼容,新增 resolve_entity_info_cached
This commit is contained in:
iven
2026-04-17 10:23:43 +08:00
parent 3b0b78c4cb
commit 091d517af6
6 changed files with 103 additions and 16 deletions

View File

@@ -371,6 +371,10 @@ async fn main() -> anyhow::Result<()> {
redis: redis_client.clone(),
default_tenant_id,
plugin_engine,
plugin_entity_cache: moka::sync::Cache::builder()
.max_capacity(1000)
.time_to_idle(std::time::Duration::from_secs(300))
.build(),
};
// --- Build the router ---