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:
@@ -108,6 +108,15 @@ func main() {
|
||||
api.Any("/knowledge-points/*path", contentHandler)
|
||||
api.Any("/questions", contentHandler)
|
||||
api.Any("/questions/*path", contentHandler)
|
||||
|
||||
// data-ana 服务路由(学情诊断/错题本)
|
||||
dataAnaProxy, err := proxy.NewProxy(cfg.DataAnaServiceURL)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create data-ana proxy: %v", err)
|
||||
}
|
||||
dataAnaHandler := proxy.ProxyHandler(dataAnaProxy)
|
||||
api.Any("/analytics", dataAnaHandler)
|
||||
api.Any("/analytics/*path", dataAnaHandler)
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
|
||||
Reference in New Issue
Block a user