Phase 5:将预种数据集成到 contribution-service 2.0 算力体系。 === 新增文件(11 个) === - prisma/pre-planting/schema.prisma:独立 Prisma schema(4 张追踪表) - PrePlantingPrismaService + Module:独立 PrismaClient - PrePlantingCdcConsumerService:独立 CDC 消费者(consumer group: contribution-pre-planting-cdc) - PrePlantingOrderSyncedHandler:订单 CDC handler + synced_adoptions marker 插入 - PrePlantingPositionSyncedHandler:持仓 CDC handler - PrePlantingCdcDispatcher:CDC 事件分发器 - PrePlantingContributionService:1/5 算力计算(复用领域计算器) - PrePlantingFreezeScheduler:每日冻结/解冻调度(凌晨 5 点) - PrePlantingCdcModule:模块注册 - constants.ts:10B 偏移量、冻结期限等常量 === 隔离保证 === - 独立 Kafka consumer group(contribution-pre-planting-cdc) - 独立 CDC topics(cdc.pre-planting.public.*) - 独立 Prisma schema + generated client - sourceAdoptionId 使用 10,000,000,000 偏移避免 ID 冲突 - synced_adoptions marker: contributionDistributed=true + treeCount=0 - 不更新 NetworkAdoptionProgress(预种不推高全网算力系数) - 现有代码文件零修改(仅 app.module.ts 加 1 行 import) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| schema.prisma | ||