feat: Week 4 收尾 + 架构治理 — 搜索/家长中心/Feature Flag/Docker/环境配置
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled

架构治理:
- Feature Flag 落地: Cargo.toml [features] default=["diary"] + main.rs cfg 条件编译
- 环境配置统一: AppConfig 类 + --dart-define 注入 + SSE 端口 8080→3000 修复

搜索替代方案 (无 FTS):
- SearchBloc + 标签/心情筛选接入后端 API
- JournalRepository 扩展 mood/tag 筛选参数
- 搜索页 UI 接入实际数据(替换占位文本)

家长中心最小集 (PIPL 合规):
- 后端: parent_service (绑定/查看/导出/删除/解绑) + parent_handler (6 个 API 端点)
- 前端: ParentBloc + ParentPage 功能完整实现
- 绑定孩子、只读查看日记、导出数据、删除数据、解绑

Docker 部署:
- verify.sh 健康检查脚本 (Axum/PG/Redis/OpenAPI 四项检查)

测试修复:
- home_bloc_test / calendar_bloc_test 适配 JournalRepository 新参数

验证: flutter test 84/84 pass, cargo test 76/76 pass, cargo check pass
This commit is contained in:
iven
2026-06-01 23:53:34 +08:00
parent ffde0c9e77
commit 749ef55b89
27 changed files with 2589 additions and 151 deletions

View File

@@ -3,6 +3,10 @@ name = "erp-server"
version.workspace = true
edition.workspace = true
[features]
default = ["diary"]
diary = ["dep:erp-diary"]
[[bin]]
name = "erp-server"
path = "src/main.rs"
@@ -28,7 +32,7 @@ erp-config.workspace = true
erp-workflow.workspace = true
erp-message.workspace = true
erp-plugin.workspace = true
erp-diary.workspace = true
erp-diary = { workspace = true, optional = true }
anyhow.workspace = true
uuid.workspace = true
chrono.workspace = true

View File

@@ -326,7 +326,9 @@ async fn main() -> anyhow::Result<()> {
);
// Initialize diary module (暖记业务)
#[cfg(feature = "diary")]
let diary_module = erp_diary::DiaryModule;
#[cfg(feature = "diary")]
tracing::info!(
module = diary_module.name(),
version = diary_module.version(),
@@ -338,8 +340,10 @@ async fn main() -> anyhow::Result<()> {
.register(auth_module)
.register(config_module)
.register(workflow_module)
.register(message_module)
.register(diary_module);
.register(message_module);
#[cfg(feature = "diary")]
let registry = registry.register(diary_module);
tracing::info!(
module_count = registry.modules().len(),
"Modules registered"
@@ -501,8 +505,12 @@ async fn main() -> anyhow::Result<()> {
.merge(erp_config::ConfigModule::protected_routes())
.merge(erp_workflow::WorkflowModule::protected_routes())
.merge(erp_message::MessageModule::protected_routes())
.merge(erp_plugin::module::PluginModule::protected_routes())
.merge(erp_diary::DiaryModule::protected_routes())
.merge(erp_plugin::module::PluginModule::protected_routes());
#[cfg(feature = "diary")]
let protected_routes = protected_routes.merge(erp_diary::DiaryModule::protected_routes());
let protected_routes = protected_routes
.merge(handlers::audit_log::audit_log_router())
.route(
"/upload",

View File

@@ -110,6 +110,7 @@ impl FromRef<AppState> for erp_plugin::state::PluginState {
}
/// Allow erp-diary handlers to extract their required state.
#[cfg(feature = "diary")]
impl FromRef<AppState> for erp_diary::DiaryState {
fn from_ref(state: &AppState) -> Self {
Self {