nac-onboarding/docs/CHANGELOG.md

55 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 变更日志 (CHANGELOG)
## 2026-03-22
### 修复 (fix)
**工单 #1**: 修复 `GET /api/assets/{id}` 接口 `onchain_info` 字段聚合不完整
**问题描述**
调用 `GET /api/assets/{asset_id}` 接口时,返回的 `onchain_info` 字段中所有链上数据DNA Hash、Chain TX、Token Symbol、Token Address、XTZH Minted 等)均为空值(`--`),但前端界面能正确显示这些数据。
**根本原因**
API 接口直接返回 MongoDB 文档,没有从各步骤专用字段中聚合链上数据。链上数据分散存储在:
- `doc["dna"]["hash"]` — DNA 哈希Step 5
- `doc["warrant"]["tx_hash"]` — 链上交易哈希Step 6
- `doc["token"]["symbol"]` — 代币符号Step 14
- `doc["token"]["address"]` — 代币地址Step 14
- `doc["xtzh"]["amount"]` — XTZH 铸造量Step 13
- 等其他字段
**修复方案**
`backend/routers/assets.py` 中新增 `_build_onchain_info()` 函数,遍历各步骤专用字段,聚合完整的 `onchain_info` 对象并注入到 API 响应中。
**修复文件**
- `backend/routers/assets.py`(新增 `_build_onchain_info()` 函数,修改 `get_asset()` 接口)
**验证结果**
- onchain_info.dna_hash ✅
- onchain_info.chain_tx ✅
- onchain_info.token_symbol ✅
- onchain_info.token_address ✅
- onchain_info.xtzh_minted ✅
- onchain_info.token_supply ✅
- onchain_info.valuation_usd ✅
- onchain_info.compliance_score ✅
- onchain_info.warrant_id ✅
- onchain_info.custody_id ✅
- onchain_info.exchange_listed ✅
- onchain_info.block_height — 模拟值(`--`),正常
---
**MongoDB 开机自启修复**
创建 `/etc/systemd/system/mongod.service` 服务文件,确保服务器重启后 MongoDB 自动启动。
---
## 历史版本
### 2026-03-08部署
- 初始部署一键上链系统 v3.0
- 17 步工作流完整实现
- AI 合规审查7 层验证)
- XTZH 铸造和代币发行功能