Fundamental_Analysis/services/data-persistence-service/Cargo.toml
Lv, Qi a1e4b265ba feat(config): Implement database-centric LLM provider architecture
本次提交完成了一次全面的架构重构,实现了以数据库为中心的、支持多供应商的LLM配置体系。

**核心变更**:
1.  **数据库驱动配置**: 废弃了所有基于本地文件的配置方案 (`analysis-config.json`),将LLM Provider和分析模块的配置作为结构化数据存入数据库的`system_config`表中,由`data-persistence-service`统一管理。
2.  **Schema-in-Code**: 在`common-contracts`中定义了所有配置的Rust Structs,作为整个系统的“单一事实源”,确保了端到端的类型安全。
3.  **服务职责重构**:
    *   `data-persistence-service`吸收了配置管理功能,成为配置的“守门人”。
    *   `config-service-rs`服务已被彻底移除。
    *   `report-generator-service`重构为可以为每个任务动态创建使用不同Provider配置的LLM客户端。
4.  **前端功能增强**:
    *   新增了独立的`/llm-config`页面,用于对LLM Providers及其可用模型进行完整的CRUD管理,并支持模型自动发现。
    *   重构了旧的`/config`页面,为分析模块提供了级联选择器来精确指定所需的Provider和Model。

此次重构极大地提升了系统的灵活性和可扩展性,完全对齐了“配置即数据”的现代化设计原则。
2025-11-17 04:41:36 +08:00

86 lines
2.5 KiB
TOML

[package]
name = "data-persistence-service"
version = "0.1.2"
edition = "2024"
authors = ["Lv, Qi <lvsoft@gmail.com>"]
default-run = "data-persistence-service-server"
[lib]
name = "data_persistence_service"
path = "src/lib.rs"
[[bin]]
name = "data-persistence-service-server"
path = "src/main.rs"
[[bin]]
name = "api-cli"
path = "src/bin/api-cli.rs"
# The cli feature is not yet compatible with the new architecture.
# required-features = ["service_kit/api-cli"]
[dependencies]
service_kit = { version = "0.1.2", default-features = true }
anyhow = "1.0"
rmcp = { version = "0.8.5", features = [
"transport-streamable-http-server",
"transport-worker"
] }
common-contracts = { path = "../common-contracts" }
# Web framework
axum = "0.8"
tokio = { version = "1.0", features = ["full"] }
tower-http = { version = "0.6.6", features = ["cors", "trace"] }
tower = { version = "0.5", features = ["util"] }
# Observability
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# OpenAPI & Schema
utoipa = { version = "5.4", features = ["axum_extras", "chrono", "uuid"] }
utoipa-swagger-ui = { version = "9.0", features = ["axum"] }
# Environment variables
dotenvy = "0.15"
# Error Handling
thiserror = "2.0.17"
# Database
sqlx = { version = "0.8.6", features = [ "runtime-tokio-rustls", "postgres", "chrono", "uuid", "json", "rust_decimal" ] }
rust_decimal = { version = "1.36", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["serde", "v4"] }
# WASM CLI UI
rust-embed = "8.7"
axum-embed = "0.1.0"
[dev-dependencies]
http-body-util = "0.1"
tower = { version = "0.5", features = ["util"] }
# Feature 管理:默认全部启用,可选择性关闭
[features]
default = ["swagger-ui"]
swagger-ui = []
wasm-cli = []
# 让模板的 `mcp` 特性联动 service_kit 的 mcp 功能
mcp = ["service_kit/mcp"]
# 可选:透传 api-cli 给 service_kit
# api-cli = ["service_kit/api-cli"]
full-data = []
# --- For Local Development ---
# If you are developing `service_kit` locally, uncomment the following lines
# in your project's `.cargo/config.toml` file (create it if it doesn't exist)
# to make Cargo use your local version instead of the one from git.
#
# [patch.'https://github.com/lvsoft/service_kit']
# service_kit = { path = "../service_kit" } # Note: Adjust the path if your directory structure is different.