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-01-26 13:47:53 +08:00
2026-05-26 11:28:26 +08:00
2026-04-22 10:44:13 +08:00
2026-02-25 11:02:06 +08:00
2026-07-16 13:08:37 +08:00
2026-07-16 11:26:12 +08:00
2026-05-26 12:01:58 +08:00
2026-01-26 13:47:53 +08:00