Files
selfrelease a329d4906b init: AIGC-Hub/AVCC 方案文档 + TCS-IPTV 内容可信锁定系统 MVP
- 方案文档: AVCC 体系建设、IPTV TCS 需求(0-req)/PRD(1-prd)/任务(2-task)/二三四期任务
- tcs-iptv: Go 后端(哈希SDK/MA码生成/可信数据空间mock/业务编排/HTTP API+HMAC鉴权)
- web-console: React+AntD 监管大屏(角色工作台/全流程演示/监管片库)
- 一剧一码+集级哈希, 集级下架/恢复, 全栈测试通过
2026-06-14 16:50:31 +08:00

80 lines
2.3 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.
# TCS-IPTV 内容可信锁定系统
> MA码(监管身份)+ 哈希码(技术指纹)双锚定,在 CP / 审核和监管部门 / 运营商 三方系统之上建立"可信身份映射层"。
>
> 上游文档:`../0-req-IPTV.md`(需求)、`../1-prd-IPTV.md`PRD)、`../2-task-IPTV.md`(任务)
## 技术栈
- 后端 / 链交互 / 哈希SDKGo 1.23 + Gin
- 智能合约:GoChainMaker 链原生)
- 联盟链:长安链 ChainMaker 2.x(国密)
- 数据库 / 缓存:PostgreSQL 16 / Redis 7.x
- 监管大屏:React 18 + Ant Design 5 + ECharts
## 工程结构
```
tcs-iptv/
├── cmd/ # 各服务入口
│ ├── api-svc/ # 业务后端(验真/签发/映射/下架/查询)
│ ├── chain-svc/ # 链交互服务(封装 ChainMaker SDK
│ └── hash-api/ # 哈希SDK 的 HTTP API
├── internal/ # 内部包
│ ├── hash/ # 哈希核心(SHA-256 / Merkle / 感知哈希)
│ ├── chain/ # 链客户端抽象(MVP 含 mock 实现)
│ ├── config/ # 配置加载
│ ├── httpx/ # 通用 HTTP / 鉴权中间件
│ └── model/ # 领域模型
├── contracts/ # ChainMaker Go 合约源码
│ └── tcs_registry/
├── deploy/ # 部署
│ ├── docker-compose.yml
│ └── migrations/ # 数据库迁移
├── web-console/ # 监管大屏(React
├── Makefile
└── go.mod
```
## 快速开始
> 本地直接使用已安装的 PostgreSQL / Redis,无需 Docker。
```bash
# 初始化数据库(数据库 tcs_iptv 需已创建)
make migrate
# 检查依赖
make db-check # 列出已建表
make redis-check # 应返回 PONG
# 构建全部服务
make build
# 运行测试
make test
# 启动哈希 API(示例)
make run-hash
```
环境变量(可选,缺省适配本地):
| 变量 | 默认值 |
|------|--------|
| TCS_POSTGRES_DSN | postgres://postgres@localhost:5432/tcs_iptv?sslmode=disable |
| TCS_REDIS_ADDR | localhost:6379 |
| TCS_API_ADDR | :8080 |
| TCS_CHAIN_ADDR | :8081 |
| TCS_HASH_ADDR | :8082 |
## 服务端口(默认)
| 服务 | 端口 |
|------|------|
| api-svc | 8080 |
| chain-svc | 8081 |
| hash-api | 8082 |
| PostgreSQL | 5432 |
| Redis | 6379 |