Fundamental_Analysis/services/report-generator-service/src/config.rs
Lv, Qi 03b53aed71 feat: Refactor Analysis Context Mechanism and Generic Worker
- Implemented Unified Context Mechanism (Task 20251127):
  - Decoupled intent (Module) from resolution (Orchestrator).
  - Added ContextResolver for resolving input bindings (Manual Glob/Auto LLM).
  - Added IOBinder for managing physical paths.
  - Updated GenerateReportCommand to support explicit input bindings and output paths.

- Refactored Report Worker to Generic Execution (Task 20251128):
  - Removed hardcoded financial DTOs and specific formatting logic.
  - Implemented Generic YAML-based context assembly for better LLM readability.
  - Added detailed execution tracing (Sidecar logs).
  - Fixed input data collision bug by using full paths as context keys.

- Updated Tushare Provider to support dynamic output paths.
- Updated Common Contracts with new configuration models.
2025-11-28 20:11:17 +08:00

28 lines
648 B
Rust

use serde::Deserialize;
#[derive(Debug, Deserialize, Clone)]
pub struct AppConfig {
pub server_port: u16,
pub nats_addr: String,
pub data_persistence_service_url: String,
pub workflow_data_path: String,
}
fn default_workflow_data_path() -> String {
"/app/data".to_string()
}
impl AppConfig {
pub fn load() -> Result<Self, config::ConfigError> {
let config = config::Config::builder()
.add_source(
config::Environment::default()
.separator("__")
.ignore_empty(true),
)
.build()?;
config.try_deserialize()
}
}