fix(api): 限制回流频率并隐藏后台错误详情 (#43)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
fu500f
2026-10-31 00:52:20 +00:00
co-authored by Devin AI
parent 36f9c95fa7
commit 8a29423451
7 changed files with 200 additions and 57 deletions
+1
View File
@@ -119,6 +119,7 @@ curl "https://goods.tangshasha.com/api/v1/products/barcode/5449000000996"
### `POST /api/public/backflow` — 批量回流未收录商品
- 鉴权:请求头携带 `X-API-Key: og_live_xxxxxxxx`(或 `Authorization: Bearer og_live_xxxxxxxx`)。缺失/无效/已吊销返回 `401`。
- 限速:按 API key 使用每小时固定窗口,默认每小时 30 次,可通过 `GOODS_BACKFLOW_RATE_PER_HOUR` 配置。超限返回 `429` 和 `Retry-After`;Redis 不可用时按现有策略放行。
- 请求体:商品对象**数组**(与公众投稿同结构),单次最多 `1000` 条。常用字段:
| 字段 | 必填 | 说明 |