feat(data-ana): 完善学情诊断服务并添加ClickHouse降级模式

config.py ClickHouse连接改可选+加DEV_MODE/kafka_brokers

clickhouse_client.py 降级模式: host为空时返回None

main.py 端点先查ClickHouse降级返回骨架数据+新增errorbook

新增clickhouse-init.sql创建宽表和错题表

Gateway添加/analytics路由
This commit is contained in:
SpecialX
2026-07-09 08:58:39 +08:00
parent 5f18821302
commit 421edd8a41
8 changed files with 1242 additions and 593 deletions

View File

@@ -15,6 +15,7 @@ type Config struct {
TeacherBffURL string
CoreEduServiceURL string
ContentServiceURL string
DataAnaServiceURL string
OTLPEndpoint string
LogLevel string
DevMode bool
@@ -31,6 +32,7 @@ func Load() *Config {
TeacherBffURL: getEnv("TEACHER_BFF_URL", "http://localhost:3003"),
CoreEduServiceURL: getEnv("CORE_EDU_SERVICE_URL", "http://localhost:3004"),
ContentServiceURL: getEnv("CONTENT_SERVICE_URL", "http://localhost:3005"),
DataAnaServiceURL: getEnv("DATA_ANA_SERVICE_URL", "http://localhost:3006"),
OTLPEndpoint: getEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4318"),
LogLevel: getEnv("LOG_LEVEL", "info"),
DevMode: getEnvBool("DEV_MODE", false),