yueli
347f20497c
feat: Redis幂等锁 + 关键端点防重复提交
## decorators.py
- 新增 @prevent_double_submit(lock_timeout=5) 装饰器
Redis key: idem:{user_id}:{path}:{MD5(body)}
锁存在→409, 不存在→setex→执行业务→delete
Redis不可用时fail-open降级放行
## purchase.py
- POST /purchase (创建): +@prevent_double_submit
- PATCH /purchase/<id>/approve (审批): +@prevent_double_submit
## outbound.py
- POST /outbound (出库): +@prevent_double_submit
## transactions.py
- POST /borrow/dispatch (借库扣减): +@prevent_double_submit
2026-07-16 13:08:37 +08:00
..
2026-07-16 13:08:37 +08:00
2026-05-22 10:59:39 +08:00
2026-05-26 11:28:26 +08:00
2026-04-28 16:46:12 +08:00
2026-07-14 17:02:07 +08:00
2026-07-15 11:11:40 +08:00
2026-05-26 11:28:26 +08:00
2026-05-12 15:17:42 +08:00
2026-04-02 10:31:53 +08:00