feat(commerce): 排盘保存需显式同意,默认本地计算不上传
- 前端免费排盘默认不保存,勾选同意后才调用保存接口 - 服务端要求 consentVersion,记录 consentAt,校验并限流公开保存接口 - 付费结算单独披露报告快照与订单信息将由服务端存储 - 管理端展示同意版本与时间,历史无同意证据记录保留并标注 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
ea6828b925
commit
132fef051b
+5
-4
@@ -53,8 +53,11 @@ go test ./...
|
||||
- `GET /api/commerce/reports/:reportId/access` — 查询报告权益。
|
||||
- `GET /api/commerce/reports` — 本人已购报告。
|
||||
- `GET /api/commerce/reports/recover/:accessCode` — 使用恢复码读取购买时快照。
|
||||
- `POST /api/commerce/charts` — 用户主动同意后保存免费排盘记录;接口限流并记录同意版本与时间。
|
||||
|
||||
除 Webhook 外,商业接口都要求 `Authorization: Bearer <JWT>`。
|
||||
除 Webhook 和需同意的公开排盘记录接口外,商业接口都要求 `Authorization: Bearer <JWT>`。
|
||||
|
||||
免费排盘默认不上传。创建付费订单时,报告快照会发送并保存在服务端,用于生成、交付和恢复已购报告。
|
||||
|
||||
## 管理后台
|
||||
|
||||
@@ -78,14 +81,12 @@ go test ./...
|
||||
|
||||
## 数据库
|
||||
|
||||
新安装由 GORM AutoMigrate 创建表。已有 MySQL 数据库先备份,再单独执行:
|
||||
新安装由 GORM AutoMigrate 创建表。商业排盘记录新增同意版本和时间字段,服务启动时通过 AutoMigrate 增量添加;已有 MySQL 数据库应先备份再升级,不要执行数据库 fresh 或 refresh。商业表结构初始化脚本仍为:
|
||||
|
||||
```bash
|
||||
mysql < migrations/002_commerce.sql
|
||||
```
|
||||
|
||||
不要执行数据库 fresh 或 refresh。
|
||||
|
||||
## 环境变量
|
||||
|
||||
完整模板见 `.env.example`。生产环境至少需要:
|
||||
|
||||
Reference in New Issue
Block a user