feat(data-ana): 完整实现 data-ana 数据分析服务

包含 CDC consumer、analytics/mastery/warning service、grpc server、repository、ClickHouse DDL 等
This commit is contained in:
SpecialX
2026-07-10 19:09:27 +08:00
parent 033057a302
commit ca3780aa24
29 changed files with 5401 additions and 383 deletions

View File

@@ -1,7 +1,7 @@
[project]
name = "data-ana-service"
version = "0.1.0"
description = "数据分析服务 - ClickHouse + 学习分析"
version = "1.0.0"
description = "数据分析服务 - ClickHouse 宽表 + CDC + 掌握度算法 + 预警"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115.0",
@@ -17,6 +17,13 @@ dependencies = [
"structlog>=24.4.0",
# CDC 链路:消费 Debezium 写入 Kafka 的 MySQL binlog 变更事件
"aiokafka>=0.11.0",
# RedisDataScope 缓存 + 事件去重 + 预警去重位图
"redis>=5.0.0",
# gRPCAnalyticsService 12 RPC + HealthService端口 50055
"grpcio>=1.66.0",
"grpcio-health-checking>=1.66.0",
# protobuf 运行时buf generate 生成的 stub 依赖)
"protobuf>=5.28.0",
]
[tool.ruff]
@@ -25,3 +32,9 @@ target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "SIM"]
[tool.ruff.lint.per-file-ignores]
# gRPC servicer 方法必须用 PascalCaseproto 契约约定N802 不适用
"src/data_ana/grpc_server.py" = ["N802"]
# FastAPI 标准模式Depends/Query 在参数默认值中调用B008 不适用
"src/data_ana/main.py" = ["B008"]