新增 mp 产品线列表 productType 过滤参数说明 (PR #1496)
这个提交包含在:
父节点
262dc37dcb
当前提交
6728f078ff
@ -0,0 +1,60 @@
|
|||||||
|
# mp 产品线列表新增 productType 过滤参数(活参数)
|
||||||
|
|
||||||
|
**日期**: 2026-04-27
|
||||||
|
**PR**: #1496 (Closes #1495)
|
||||||
|
**影响端**: 小程序 mp
|
||||||
|
|
||||||
|
## 行为变化
|
||||||
|
|
||||||
|
`GET /mp/product-line/list` 新增可选 query 参数 `productType`:
|
||||||
|
|
||||||
|
| 取值 | 返回 |
|
||||||
|
|---|---|
|
||||||
|
| 不传(旧行为,向后兼容)| 全部启用主题(CORE+GROUP+CUSTOM)|
|
||||||
|
| `CORE` | 仅 CORE 类型主题 |
|
||||||
|
| `GROUP` | 仅 GROUP 类型主题 |
|
||||||
|
| `CUSTOM` | 仅 CUSTOM 类型主题 |
|
||||||
|
| 不存在的 value(如 `XYZ`)| 空数组(兜底不报错)|
|
||||||
|
|
||||||
|
可与已有 `season` 参数叠加:`?season=summer&productType=CORE`。
|
||||||
|
|
||||||
|
## 验收实证(测试服 2026-04-27 部署后)
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /mp/product-line/list → count=6 types=['CORE','GROUP']
|
||||||
|
GET /mp/product-line/list?productType=CORE → count=5 types=['CORE']
|
||||||
|
GET /mp/product-line/list?productType=GROUP → count=1 types=['GROUP']
|
||||||
|
GET /mp/product-line/list?productType=XYZ → count=0
|
||||||
|
```
|
||||||
|
|
||||||
|
## ⚠️ 前端必改(活参数,不靠后端兜底)
|
||||||
|
|
||||||
|
字典 `theme_card_link_type` 4 种跳转目标的产品线列表语义已统一:
|
||||||
|
|
||||||
|
| 跳转字典值 | 跳转页路径 | 调用接口要传 |
|
||||||
|
|---|---|---|
|
||||||
|
| `SEASON`(季节之旅)| packages/product/season/list | **`?productType=CORE`** |
|
||||||
|
| `CORE_LIST`(核心产品)| packages/product/core/list | **`?productType=CORE`** |
|
||||||
|
| `MENGMA`(亲子游学)| packages/product/mengma/list | **`?productType=GROUP`** |
|
||||||
|
| `PRODUCT`(指定产品)| 直跳详情 | -(不调此接口)|
|
||||||
|
|
||||||
|
**前端要改的页面**:
|
||||||
|
- 季节之旅 list 页面:query 加 `?productType=CORE`
|
||||||
|
- 核心产品 list 页面(如有独立路由):`?productType=CORE`
|
||||||
|
- 亲子游学 list 页面:`?productType=GROUP`
|
||||||
|
|
||||||
|
不传参数时返回全部类型混合,会显示混乱(用户已反馈过这个 BUG)。
|
||||||
|
|
||||||
|
## 缓存 key 变化
|
||||||
|
|
||||||
|
```
|
||||||
|
旧:mp:product-lines / mp:product-lines:summer
|
||||||
|
新:mp:product-lines / mp:product-lines:season=summer / mp:product-lines:type=CORE / mp:product-lines:season=summer:type=CORE
|
||||||
|
```
|
||||||
|
|
||||||
|
部署后旧 season 缓存条目自然 TTL(10min)失效,无需手动清。
|
||||||
|
|
||||||
|
## 后台行为
|
||||||
|
|
||||||
|
- admin 后台「产品线列表」`/admin/product/line/list` **不受影响**
|
||||||
|
- 仅 mp 端展示层加过滤
|
||||||
正在加载...
x
在新工单中引用
屏蔽一个用户