rwadurian/backend/services/mining-service
hailin 9062346650 refactor(system-accounts): 移除 baseType 字段,使用 accountType+regionCode 复合唯一键
## 主要变更

### 数据模型简化
- 移除冗余的 baseType 字段,accountType 已包含类型信息
- 使用 accountType (OPERATION/PROVINCE/CITY/HEADQUARTERS) + regionCode (省市代码) 作为复合唯一键
- 所有查询改用 accountType+regionCode,100% 弃用数据库自增 ID

### contribution-service
- SystemAccount 表移除 baseType,改用 accountType+regionCode 唯一约束
- 修改算力分配逻辑,省市账户使用对应 regionCode
- 事件发布增加 regionCode 字段

### mining-service
- SystemMiningAccount 表使用 accountType+regionCode 唯一约束
- API 改为 /system-accounts/:accountType/records?regionCode=xxx 格式
- 挖矿分配逻辑支持按省市细分

### mining-admin-service
- SyncedSystemContribution 表使用 accountType+regionCode 唯一约束
- CDC 同步处理器适配新格式
- API 统一使用 accountType+regionCode 查询

## API 示例
- 运营账户: GET /admin/system-accounts/OPERATION/records
- 广东省: GET /admin/system-accounts/PROVINCE/records?regionCode=440000
- 广州市: GET /admin/system-accounts/CITY/records?regionCode=440100
- 总部: GET /admin/system-accounts/HEADQUARTERS/records

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:29:01 -08:00
..
prisma refactor(system-accounts): 移除 baseType 字段,使用 accountType+regionCode 复合唯一键 2026-01-20 21:29:01 -08:00
src refactor(system-accounts): 移除 baseType 字段,使用 accountType+regionCode 复合唯一键 2026-01-20 21:29:01 -08:00
.env.example fix: correct totalShares and distributionPool values 2026-01-17 09:01:17 -08:00
DEVELOPMENT_GUIDE.md feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
Dockerfile fix(mining-service): 添加Dockerfile构建验证步骤 2026-01-14 03:45:51 -08:00
nest-cli.json feat(mining-ecosystem): 添加挖矿生态系统完整微服务与前端 2026-01-10 17:45:46 -08:00
package-lock.json fix: update mining-service package-lock.json 2026-01-11 09:12:48 -08:00
package.json feat(mining): 实现每秒挖矿分配系统 2026-01-14 03:25:47 -08:00
tsconfig.json fix(mining-service): 添加tsconfig include/exclude配置修复构建 2026-01-14 03:48:18 -08:00