diff --git a/changelogs/2026-03/31_refactor_price_calendar_field_rename.md b/changelogs/2026-03/31_refactor_price_calendar_field_rename.md new file mode 100644 index 0000000..0fccf3a --- /dev/null +++ b/changelogs/2026-03/31_refactor_price_calendar_field_rename.md @@ -0,0 +1,48 @@ +# 价格日历接口字段优化(price→adultPrice) + +- **日期**: 2026-03-31 +- **服务**: hl-product-service, hl-mp-service +- **PR**: #91 + +## ⚠️ 破坏性变更 + +### `GET /mp/product/{id}/price-calendar` + +**字段重命名**: +| 旧字段 | 新字段 | 说明 | +|--------|--------|------| +| `price` | `adultPrice` | 成人价格,与其他人员类型命名保持一致 | + +**移除字段**: +- `id` — 价格日历记录ID,前端无需使用 +- `productId` — 已在URL路径中,无需重复返回 +- `dateStr` — 与 `date` 重复 + +**完整响应结构**(每日一条): +```json +{ + "date": "2026-04-01", + "adultPrice": 3980, + "childPrice": 2980, + "youngChildPrice": 1490, + "babyPrice": 500, + "childWithBedFee": 200, + "stock": 10, + "sold": 2, + "status": 1, + "remark": null +} +``` + +**4种人员类型价格**: +| 字段 | 说明 | +|------|------| +| `adultPrice` | 成人价格 | +| `childPrice` | 儿童价格(占床) | +| `youngChildPrice` | 小童价格(不占床) | +| `babyPrice` | 幼童价格 | + +## 前端需要改动 + +1. 价格日历组件中 `price` 改为 `adultPrice` +2. 移除对 `id`、`productId`、`dateStr` 的依赖(如有)