update 优惠券接口

This commit is contained in:
Guoqs
2026-03-05 08:58:24 +08:00
parent c231c322f8
commit 675dfd4b95
3 changed files with 25 additions and 18 deletions

View File

@@ -118,7 +118,14 @@
---
## 关键设计决策
## 前端页面
| # | 子任务 | 状态 | 文件 |
|---|--------|------|------|
| F1 | API 文件 | ✅ 完成 | `jsowell-charge-ui/src/api/coupon/template.js` / `record.js` |
| F2 | 券模板管理页 | ✅ 完成 | `jsowell-charge-ui/src/views/coupon/template/index.vue` |
| F3 | 兑换记录页 | ✅ 完成 | `jsowell-charge-ui/src/views/coupon/record/index.vue` |
| F4 | 路由注册 | ✅ 完成 | `jsowell-charge-ui/src/router/index.js` |
1. **兑换幂等**`member_coupon.exchange_request_id` 唯一索引,捕获 `DuplicateKeyException` 返回已有结果
2. **库存扣减**`UPDATE ... SET stock_remain=stock_remain-1 WHERE id=? AND (stock_remain>0 OR stock_remain=-1)`