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 |
hailin
|
a539b33dff
|
fix(contribution-service): 优化账户查询API返回有意义的业务状态
- 新增 ContributionAccountStatus 枚举区分三种状态:
- ACTIVE: 账户正常,有算力数据
- INACTIVE: 用户存在但暂无认种记录
- USER_NOT_FOUND: 账户不存在
- 移除 404 错误响应,统一返回 200 并通过 status 和 message 字段描述状态
- 为不同状态提供友好的中文提示信息
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 17:13:38 -08:00 |
hailin
|
5ee6caa190
|
fix(contribution-service): 修复Kafka消息BigInt序列化错误
JSON.stringify无法序列化BigInt,添加自定义replacer将BigInt转换为字符串
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:57:21 -08:00 |
hailin
|
a40e314c94
|
fix(contribution-service): 修复adoption handler事务嵌套问题
将upsertSyncedAdoption和calculateForAdoption分离为两个独立操作,
避免嵌套事务导致内层事务看不到外层事务尚未提交的数据
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:52:00 -08:00 |
hailin
|
5006a5a170
|
fix(contribution-service): 修复synced_adoptions.status字段长度
1.0 planting_orders.status是VARCHAR(30),2.0需要匹配以避免数据截断错误
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:45:08 -08:00 |
hailin
|
5f76108579
|
fix(contribution-service): 修复CDC消息解析以支持Debezium扁平化格式
Debezium配置了ExtractNewRecordState转换,消息格式是扁平化的:
- 元数据字段使用__前缀(__op, __table, __source_ts_ms, __deleted)
- 业务数据字段直接在根级别
- 修改handleMessage方法正确解析扁平化格式
- 更新CDCEvent接口以匹配实际消息结构
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:39:09 -08:00 |
hailin
|
4b55c63e71
|
fix(contribution-service): 修复CDC同步字段映射,支持完整同步referral数据
主要更改:
1. synced_referrals表增加referrer_user_id和original_user_id字段
- 1.0的referral_relationships表只有referrer_id(user_id),没有referrer_account_sequence
- 保存原始user_id以便后续解析推荐人的account_sequence
2. 修复referral-synced.handler字段映射
- 正确处理1.0的user_id、referrer_id、ancestor_path字段
- ancestor_path从BigInt[]数组转换为逗号分隔的字符串
3. 修复cdc-event-dispatcher表名注册
- 使用正确的表名: referral_relationships, planting_orders
- 移除不需要的user_accounts注册
4. 更新docker-compose.2.0.yml
- 添加CDC_TOPIC_REFERRALS配置
- 移除未使用的CDC_TOPIC_PAYMENTS
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:27:01 -08:00 |
hailin
|
05a8168a31
|
fix(contribution-service): 修复CDC同步配置,使用正确的planting-service topic
- 修改CDC topic为cdc.planting.public.planting_orders
- 更新healthcheck使用api/v2
- 更新handler适配planting_orders表字段
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:18:37 -08:00 |
hailin
|
a14daae222
|
fix: update mining-service package-lock.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:12:48 -08:00 |
hailin
|
0e05139c01
|
fix(contribution-service): 统一使用api/v2前缀
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-01-11 09:05:42 -08:00 |