docs: 新增数据库迁移指南 + 迁移脚本,同步目录结构文档

- 新增 docs/数据库迁移.md: clone 后如何建表(alembic upgrade head)、日常升级、
  新增迁移、迁移文件名 vs revision id 的关系与去前缀注意事项、当前 9 条迁移链
- 新增 scripts/migrate.sh: 只做迁移不启服务(部署/CI 用),run.sh 已自动包含
- 后端技术实现.md 目录树: crud 并入 repositories、alembic 文件名去 hex 说明、
  补 docs/数据库迁移.md;接口层"调 repositories/integration"措辞同步
- README.md / docs/integrations 残留 crud 提法同步为 repositories

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
OuYingJun1024
2026-05-27 21:04:25 +08:00
parent a4d214964a
commit c61997b876
6 changed files with 117 additions and 13 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
> 文件:`app/integrations/pangle.py` | 关联接口:[ad-pangle-callback](../api/ad-pangle-callback.md) | [← 集成索引](./README.md)
## 作用
穿山甲激励视频播完后,穿山甲**服务器**会 GET 回调我们的 `/api/v1/ad/pangle-callback`(带 `user_id` / `trans_id` / `sign` 等 query)。本模块负责**验签**,确认回调真来自穿山甲而非伪造请求;验签通过后由 crud 幂等发金币。客户端不参与发奖,被破解也刷不到钱。
穿山甲激励视频播完后,穿山甲**服务器**会 GET 回调我们的 `/api/v1/ad/pangle-callback`(带 `user_id` / `trans_id` / `sign` 等 query)。本模块负责**验签**,确认回调真来自穿山甲而非伪造请求;验签通过后由数据层(`repositories/ad_reward`幂等发金币。客户端不参与发奖,被破解也刷不到钱。
## 验签方案(关键)
**`sign = SHA256("{m-key}:{trans_id}")` 的十六进制串。**