hailin
|
30b04c6376
|
feat(sync): 完善 CDC 数据同步 - 添加推荐关系、认种记录和昵称字段
- auth-service:
- SyncedLegacyUser 表添加 nickname 字段
- LegacyUserMigratedEvent 添加 nickname 参数
- CDC consumer 同步 nickname 字段
- SyncedLegacyUserData 接口添加 nickname
- contribution-service:
- 新增 ReferralSyncedEvent 事件类
- 新增 AdoptionSyncedEvent 事件类
- admin.controller 添加 publish-all APIs:
- POST /admin/referrals/publish-all
- POST /admin/adoptions/publish-all
- mining-admin-service:
- SyncedUser 表添加 nickname 字段
- 新增 SyncedReferral 表 (推荐关系)
- 新增 SyncedAdoption 表 (认种记录)
- handleReferralSynced 处理器
- handleAdoptionSynced 处理器
- handleLegacyUserMigrated 处理 nickname
- deploy-mining.sh:
- full_reset 更新为 14 步
- Step 13: 发布推荐关系
- Step 14: 发布认种记录
解决 mining-admin-web 缺少昵称、推荐人、认种数据的问题
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 02:48:15 -08:00 |
hailin
|
11eb1f8a04
|
fix(postgres): 增加数据库最大连接数到 300
- max_connections: 100 -> 300
- max_replication_slots: 10 -> 20
- max_wal_senders: 10 -> 20
支持更多服务和 Debezium connectors 同时连接
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 02:29:35 -08:00 |
hailin
|
a4e1859fd2
|
fix(debezium): 修复 outbox connector 配置中的数据库凭证
使用实际的用户名和密码替代环境变量占位符,
因为 envsubst 不支持带默认值的变量语法
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 02:13:07 -08:00 |
hailin
|
93c9007045
|
fix(deploy): 修正 Debezium Connect 默认端口为 8084
docker-compose 中 Debezium Connect 映射到 8084 端口
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 02:11:19 -08:00 |
hailin
|
cbdb449533
|
fix(auth): 修复 LegacyUserCdcConsumer 的 OutboxService 依赖注入
- 在 ApplicationModule 中导出 OutboxService
- 在 InfrastructureModule 中使用 forwardRef 导入 ApplicationModule
- 解决循环依赖问题
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 02:00:21 -08:00 |
hailin
|
4cbdf0b503
|
fix(auth): 修复 CDC consumer 类型错误
使用 ?? 运算符正确处理可选字段:
- update 使用 undefined 保持字段不变
- create 使用 null 明确设置为空值
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 01:45:10 -08:00 |
hailin
|
40745ca580
|
feat(cdc): 完善 2.0 服务数据聚合到 mining-admin-service
1. deploy-mining.sh:
- 添加 outbox connectors 配置数组 (auth, contribution, mining, trading, wallet)
- 添加 register_outbox_connectors() 函数自动注册 Debezium 连接器
- 添加 outbox-register, outbox-status, outbox-delete 命令
- full-reset 更新为 12 步,包含注册 outbox connectors 和初始数据发布
2. contribution-service:
- 添加 ContributionAccountSyncedEvent 事件
- 添加 POST /admin/contribution-accounts/publish-all API 用于初始全量同步
3. mining-admin-service:
- 添加 ContributionAccountSynced 事件处理(复用 ContributionAccountUpdated 处理器)
- 添加 ContributionCalculated 事件处理
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 01:41:46 -08:00 |
hailin
|
489966fae9
|
feat(auth): 新 1.0 用户自动发布事件到 mining-admin-service
- auth-service CDC consumer 在同步新用户时自动发布 LegacyUserMigratedEvent
- 只有 op='c' (create) 的新用户才发布事件,snapshot 由 publish-all API 处理
- deploy-mining.sh full-reset 更新步骤编号为 10 步
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 01:25:01 -08:00 |
hailin
|
50854f04d5
|
fix(deploy): 添加 mining-admin-service-cdc-group 到 CDC 重置列表
确保 full-reset 时同时重置 mining-admin-service 的 consumer group,
使其能从头消费所有 outbox 事件。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 01:18:44 -08:00 |
hailin
|
0d06080760
|
fix(mining-admin): 兼容 Debezium outbox 消息格式
问题:Debezium 产生的 outbox 消息使用下划线命名(event_type,
aggregate_type),而代码期望驼峰格式(eventType, aggregateType)
解决方案:
- isServiceEvent() 同时检查两种命名格式
- 新增 normalizeServiceEvent() 转换 Debezium 格式到驼峰格式
- 解析 payload JSON 字符串
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 01:10:24 -08:00 |
hailin
|
273f2f1d96
|
fix(deploy): 在 migration 后再次重置 CDC offset
问题:migration 会启动容器执行迁移,导致 CDC consumer
自动启动并消费消息。在数据库重建后启动服务时,消息
已经被消费完毕。
解决方案:在 migration 后增加 Step 7,停止容器并
再次重置 CDC offset,确保最终启动时能重新消费。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 00:53:55 -08:00 |
hailin
|
350ce28c40
|
fix(deploy): 修复 sync-reset CDC offset 重置失败问题
- sync_reset() 添加 20 秒等待时间,确保 consumer group 变成 inactive
- 添加重试逻辑(最多 3 次,每次间隔 10 秒)
- 使用 grep NEW-OFFSET 检测 offset reset 是否成功
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 00:49:09 -08:00 |
hailin
|
24412794e6
|
fix(deploy-mining): 修正 full-reset 步骤顺序避免 CDC offset 重置失败
- 在 migration 之前重置 CDC offsets(因为 migration 会启动容器)
- 停止服务后等待 15 秒让 Kafka consumer 变成 inactive
- 添加重试机制,最多重试 3 次,每次间隔 10 秒
- 步骤从 6 步改为 7 步
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-12 00:33:19 -08:00 |
hailin
|
ff27195be2
|
fix(cdc): 修复用户同步字段映射和多 consumer group 重置
contribution-service:
- 修复 UserSyncedHandler 使用错误字段名 (data.id -> data.user_id)
- 兼容 CDC snake_case 字段命名 (user_id, account_sequence, phone_number)
- 添加数据验证,跳过无效记录
deploy-mining.sh:
- 添加 auth-service-cdc-group 到 CDC_CONSUMER_GROUPS
- full-reset 现在重置所有 CDC consumer groups
- sync_reset 和 sync_status 支持多个 consumer groups
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 23:59:39 -08:00 |
hailin
|
5cab38c7f1
|
fix(deploy-mining): 修正 Docker 容器名称和默认凭据
- 修正 POSTGRES_CONTAINER 为 rwa-postgres (匹配 docker-compose.yml)
- 修正 KAFKA_CONTAINER 为 rwa-kafka
- 修正 POSTGRES_USER 为 rwa_user
- 修正 POSTGRES_PASSWORD 为 rwa_secure_password
- 修复 CDC offset 重置命令使用正确的容器名和命令格式
解决 full-reset 无法删除数据库和重置 CDC offset 的问题。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 23:41:49 -08:00 |
hailin
|
5c302bfca8
|
fix(deploy-mining): 支持 Docker 环境的数据库操作和迁移
- 添加 run_psql helper 函数自动检测 Docker 或本地 psql
- 修改 db_create/db_drop/db_status 使用 docker exec
- 修改 db_migrate 支持通过容器运行 prisma migration
- 修改 health_check/show_stats 支持 Docker 环境
解决在服务器 Docker 环境中 full-reset 失败的问题。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 23:38:06 -08:00 |
hailin
|
5d880f011e
|
fix(debezium): 统一 mining-wallet-outbox-connector 数据库名称
将 database.dbname 从 mining_wallet_db 改为 rwa_mining_wallet,
与 docker-compose.2.0.yml 和 deploy-mining.sh 保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 23:31:28 -08:00 |
hailin
|
63d73af135
|
refactor(cdc): 统一使用 Debezium CDC 进行数据同步
1. contribution-service:
- 添加 identity topic 订阅,全量同步 1.0 用户数据
- 修改 fromBeginning 为 true,首次启动全量同步
2. mining-admin-service:
- 将 Outbox 事件改为 Debezium CDC 监听 outbox_events 表
- 修改 fromBeginning 为 true,首次启动全量同步
3. 新增 5 个 2.0 服务的 Debezium connector 配置:
- auth-outbox-connector.json
- contribution-outbox-connector.json
- mining-outbox-connector.json
- trading-outbox-connector.json
- mining-wallet-outbox-connector.json
4. 更新 register-connectors.sh 脚本
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 23:19:34 -08:00 |
hailin
|
cab36fccf1
|
fix(docker): 修复 contribution-service 和 mining-admin-service Dockerfile healthcheck 路径
将 healthcheck 路径从 /api/v1/health 改为 /api/v2/health,
与 main.ts 中的 API 前缀保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:56:26 -08:00 |
hailin
|
978dfcb2bf
|
feat(docker): 添加 mining-wallet-service 到 docker-compose.2.0.yml
- 添加 mining-wallet-service 服务配置
- 端口: 3025
- 数据库: rwa_mining_wallet
- Redis DB: 15
- KAVA 区块链配置
- 更新所有服务的 healthcheck 路径为 /api/v2/health
- mining-service
- trading-service
- mining-admin-service
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:53:57 -08:00 |
hailin
|
83a2800941
|
refactor(deploy): 移除 mining-admin-web 从 deploy-mining.sh
mining-admin-web 是前端项目,不应该在后端服务部署脚本中管理。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:52:26 -08:00 |
hailin
|
3c73d510b1
|
feat(deploy): 添加 mining-wallet-service 到 deploy-mining.sh
将 mining-wallet-service 加入 2.0 系统管理脚本:
- 添加到 MINING_SERVICES 数组
- 添加别名 wallet -> mining-wallet-service
- 添加数据库 rwa_mining_wallet
- 添加 SERVICE_DB 映射
- 添加端口 3025
- 更新帮助文档
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:51:19 -08:00 |
hailin
|
a4090cc285
|
fix(mining-admin-web): 修复 API rewrite 路径为 v2
将 next.config.js 中的 API rewrite 从 /api/v1 改为 /api/v2,
与 mining-admin-service 的实际 API 前缀保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:45:16 -08:00 |
hailin
|
f790d2bbe5
|
refactor(api): 升级 trading-service API 前缀至 v2
将 trading-service 的 API 版本从 v1 升级到 v2,统一 2.0 系统架构:
**trading-service:**
- main.ts: 全局前缀 api/v1 → api/v2
- Dockerfile: 健康检查路径 /api/v1/health → /api/v2/health
- transfer.service.ts: 更新调用 mining-service 的 API 路径
- /api/v1/mining/accounts/.../transfer-out → /api/v2/...
- /api/v1/mining/accounts/.../transfer-in → /api/v2/...
此变更使 trading-service 正式成为 2.0 系统的一部分,
与 auth-service、contribution-service、mining-service、
mining-admin-service、mining-wallet-service 保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:37:17 -08:00 |
hailin
|
6d619c0a02
|
refactor(api): 升级 mining-service 和 mining-wallet-service API 前缀至 v2
将以下服务的 API 版本从 v1 升级到 v2,统一 2.0 系统架构:
**mining-service:**
- main.ts: 全局前缀 api/v1 → api/v2
- Dockerfile: 健康检查路径 /api/v1/health → /api/v2/health
**mining-wallet-service:**
- main.ts: 全局前缀 api/v1 → api/v2
- Dockerfile: 健康检查路径 /api/v1/health → /api/v2/health
此变更使 mining-service 和 mining-wallet-service 正式成为 2.0 系统的一部分,
与 auth-service、contribution-service、mining-admin-service 保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 22:31:06 -08:00 |
hailin
|
05f98def6d
|
fix(sync): 修复数据同步 API 认证和响应解析
- 为 contribution/mining/trading 服务的 AdminController 添加 @Public 装饰器
- 修复 initialization.service.ts 中响应格式解析,支持 { data: { ... } } 格式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 21:47:32 -08:00 |
hailin
|
6fedebf020
|
fix(trading-service): 更新 package-lock.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 21:35:33 -08:00 |
hailin
|
3fe6bdbbf0
|
feat(sync): 添加批量同步 API 端点
- 为 contribution-service、mining-service、trading-service 添加 AdminController
- 提供 /admin/accounts/sync 端点用于批量获取账户数据
- 在 mining-admin-service 添加同步 mining/trading 账户的初始化端点
- 添加 sync-all 端点支持一键同步所有数据
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 21:27:35 -08:00 |
hailin
|
033f94c0c2
|
fix(mining-admin-web): 修复 API 响应格式转换
后端返回 records/pagination 格式,前端期望 items/total/totalPages 格式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 21:14:12 -08:00 |
hailin
|
1a7c73e531
|
feat(mining-admin): 添加用户详情页缺失的 API 端点
- 添加 referral-tree API(返回空推荐关系数据)
- 添加 planting-ledger API(返回空认种数据)
- 添加 wallet-ledger API(返回空钱包流水数据)
- 修复前端 referral-tree 组件空数据处理
注:这些 API 目前返回占位数据,完整数据需要通过 CDC 从各服务同步
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 20:53:18 -08:00 |
hailin
|
fc3efe6a27
|
fix(mining-admin-web): 修复 React hydration 错误 #418 #423
- 修改 Zustand sidebar store 使用 skipHydration 避免 SSR 不匹配
- 移除 Redux auth slice 初始状态中的 localStorage 读取
- 在 providers 中使用 useEffect 初始化客户端状态
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 20:47:00 -08:00 |
hailin
|
dc27044dab
|
fix(mining-admin-web): 修复 formatNumber 导致的 hydration 错误
将 toLocaleString 替换为确定性格式化方法,避免服务器和客户端
输出不一致导致的 React hydration 错误 #418 #423
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 20:37:32 -08:00 |
hailin
|
e0f529799f
|
fix(mining-admin): 添加 syncAllUsers 和 syncAllContributionAccounts 方法
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 20:24:48 -08:00 |
hailin
|
582beb4f81
|
feat(cdc): 添加 legacy 用户批量同步功能
auth-service:
- 添加 AdminController 和 AdminSyncService
- POST /admin/legacy-users/publish-all: 为所有 legacy 用户发布事件
- GET /admin/users/sync: 获取所有用户数据供同步
mining-admin-service:
- 添加 user.legacy.migrated 事件处理器
- 添加 sync-users 和 sync-contribution-accounts API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 20:17:46 -08:00 |
hailin
|
49b1571bba
|
fix(cdc): 修复 auth-service 与 mining-admin-service 的 CDC 事件同步
- auth-service: 将 outbox topic 从 auth.events 改为 mining-admin.auth.users
- mining-admin-service: 添加 user.registered 和 user.kyc_verified 事件处理器
- 确保 auth-service 发布的事件能被 mining-admin-service 正确接收和处理
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:51:01 -08:00 |
hailin
|
e83b3d420c
|
chore(mining-admin-service): 统一API版本为v2
- 将globalPrefix从api/v1改为api/v2
- 更新Swagger文档版本为2.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:25:49 -08:00 |
hailin
|
99550a2a9d
|
fix(mining-admin-web): 修复用户列表API响应格式不匹配问题
- 添加transformUserOverview和transformUserDetail函数
- 转换后端返回格式(data/pagination)到前端期望格式(items)
- 修复keyword到search的参数名转换
- 解决React hydration错误和数据不显示问题
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:15:55 -08:00 |
hailin
|
3fe4f82906
|
fix(mining-admin-web): 修复用户列表页面空数据和错误处理
- 修复 data.items 可能为 undefined 导致的崩溃
- 添加 API 错误状态显示
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:06:26 -08:00 |
hailin
|
2a22d7d669
|
fix(mining-admin-web): 修复用户列表页面类型错误
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:01:37 -08:00 |
hailin
|
0f1b4df583
|
fix(mining-admin-web): 添加缺失的Badge组件
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 19:00:15 -08:00 |
hailin
|
8fc527b918
|
feat(mining-admin-web): 复用admin-web用户管理功能
- 更新用户列表:添加头像、个人/团队认种、推荐人、状态徽章
- 更新用户详情:添加头像、KYC状态、认种统计卡片
- 新增引荐关系Tab:展示引荐人链和直推下级树
- 新增认种信息Tab:认种汇总和认种分类账明细
- 新增钱包信息Tab:钱包汇总和钱包分类账明细
- 更新类型定义和API hooks
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:58:48 -08:00 |
hailin
|
5dab829995
|
fix(deploy-mining): 修复rebuild命令不更新容器的问题
rebuild命令之前只调用build,现在会在构建后停止旧容器并启动新容器
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:47:25 -08:00 |
hailin
|
7a68668aa9
|
feat(auth-service): 增强登录错误提示和指数退避锁定机制
- 区分用户不存在和密码错误的提示信息
- 登录失败最多允许6次尝试
- 每次密码错误显示剩余尝试次数
- 超过次数后实现指数退避锁定(1,2,4,8...分钟,最长24小时)
- 锁定时显示剩余等待时间
- 优化mining-app底部导航栏图标间距
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:33:23 -08:00 |
hailin
|
608e22a8e7
|
fix(contribution-service): 修复JWT验证与auth-service不兼容
- 移除 type 字段检查 (auth-service 不生成此字段)
- 修复 JwtPayload 接口与 auth-service 生成的 token 结构一致
- 从 payload.sub 获取 accountSequence
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:18:21 -08:00 |
hailin
|
4d5c9e7c49
|
fix(docker): 为contribution-service添加JWT_SECRET配置
contribution-service需要JWT_SECRET来验证auth-service签发的token。
与auth-service共享相同的密钥配置。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:14:37 -08:00 |
hailin
|
a0229e653e
|
fix(mining-app): 修复登录后API请求token未更新的问题
问题原因: ApiClient使用内存缓存的token,登录后虽然保存到SharedPreferences,
但ApiClient的内存缓存未更新,导致后续请求仍使用旧token或无token。
解决方案: 移除内存缓存,每次请求都从SharedPreferences读取最新token,
确保登录后立即生效。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 18:00:33 -08:00 |
hailin
|
c35d90e94f
|
fix(kong): 修复auth-service路由配置
- 将service URL从 /api/v2 改为根路径
- 设置 strip_path: false 直接透传请求路径
- 保持前后端路径一致: /api/v2/auth/...
问题原因: strip_path: true 会移除 /api/v2/auth,
导致后端收到 /api/v2/login 而不是 /api/v2/auth/login
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 17:52:53 -08:00 |
hailin
|
461b11b310
|
fix(kong): 修复contribution-service路由配置
- 将service URL从 /api/v2/contributions 改为根路径
- 设置 strip_path: false 直接透传请求路径
- 前端和后端现在都使用 /api/v2/contribution(单数)
前端请求: /api/v2/contribution/accounts/{id}
Kong转发: http://contribution-service:3020/api/v2/contribution/accounts/{id}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 17:44:49 -08:00 |
hailin
|
849f346891
|
fix(contribution-service): 修复控制器路由路径与前端API不匹配
将控制器路由从 /contributions 改为 /contribution,
与前端 api_endpoints.dart 中定义的路径保持一致。
完整路径: /api/v2/contribution/accounts/{accountSequence}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 17:42:10 -08:00 |
hailin
|
ace1e8673b
|
feat(deploy-mining): rebuild命令增加服务重启功能
rebuild命令现在会在构建完成后自动停止旧服务并启动新服务,
而不仅仅是编译镜像。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 17:18:25 -08:00 |