From 4bf04ab4a4ad52698f95bc8183d197c6efa6b53b Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Sat, 18 Apr 2026 15:47:47 +0800 Subject: [PATCH] =?UTF-8?q?2026-04-18=20=E6=88=BF=E5=9E=8B=E5=B0=81?= =?UTF-8?q?=E9=9D=A2null=E4=BF=AE=E5=A4=8D(PR=20#825)=20+=20=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=8D=A1=E7=89=87=E5=8E=BB=E9=93=BE=E6=8E=A5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B(PR=20#829)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...026-04-18_home-screen2-remove-card-link.md | 110 ++++++++++++++++++ .../2026-04-18_mp-hotel-room-cover-fix.md | 52 +++++++++ 2 files changed, 162 insertions(+) create mode 100644 changelogs/2026-04/2026-04-18_home-screen2-remove-card-link.md create mode 100644 changelogs/2026-04/2026-04-18_mp-hotel-room-cover-fix.md diff --git a/changelogs/2026-04/2026-04-18_home-screen2-remove-card-link.md b/changelogs/2026-04/2026-04-18_home-screen2-remove-card-link.md new file mode 100644 index 0000000..043146f --- /dev/null +++ b/changelogs/2026-04/2026-04-18_home-screen2-remove-card-link.md @@ -0,0 +1,110 @@ +# 小程序首页第二屏 - 主题卡片去掉"链接类型"字段 + +- **日期**: 2026-04-18 +- **PR**: [#829](https://git.1814.love:8443/wx/HL/pulls/829) (Closes #828) +- **类型**: 契约变更(减字段) +- **状态**: 已合并到 dev + 测试环境部署中 + +> 本次改动紧随同日的 [#823 首页第二屏 v2](./2026-04-18_home-screen2-v2.md)。v2 设计的"卡片链接跳转"能力产品决定取消,卡片回归纯展示。 + +--- + +## 受影响接口 + +### 管理端 +- `PUT /admin/home-config/brand-story`(保存品牌故事) +- `GET /admin/home-config/brand-story`(查询品牌故事) + +### 小程序端 +- `GET /mp/home-config/screen2`(首页第二屏聚合) + +## 删除字段(每张卡片 `cards[i]`) + +| 字段 | 类型 | 原含义 | +|---|---|---| +| ~~`linkType`~~ | String | 链接类型(NONE/PRODUCT/PRODUCT_LINE/ARTICLE/URL/MINI_PAGE) | +| ~~`linkTarget`~~ | String | 链接目标(产品/产品线 ID / URL / 小程序页面路径) | +| ~~`linkTargetType`~~ | String | 响应回填的产品类型(CORE/GROUP) | + +## 保留字段(每张卡片 `cards[i]`) + +| 字段 | 类型 | 说明 | +|---|---|---| +| `title` | String | 卡片标题(必填,≤100 字符) | +| `subtitle` | String | 卡片副标题(可选,≤200 字符) | +| `coverUrl` | String | 封面图 URL(必填,https CDN 直链,≤500 字符) | + +## 请求示例(PUT /admin/home-config/brand-story) + +```json +{ + "title": "每一条线路,我们都亲自走过。", + "subtitle": null, + "description": "整个呼伦贝尔...", + "coverUrl": "https://cdn.hulalv.com/home/brand.jpg", + "cards": [ + { + "title": "季节之旅", + "subtitle": "夏·秋·冬三季体验", + "coverUrl": "https://cdn.hulalv.com/cards/1.jpg" + }, + { + "title": "亲子研学", + "subtitle": "边玩边学·深度体验", + "coverUrl": "https://cdn.hulalv.com/cards/2.jpg" + } + ], + "publish": true +} +``` + +## 响应示例(GET /mp/home-config/screen2) + +```json +{ + "code": 200, + "data": { + "brandStory": { + "title": "每一条线路,我们都亲自走过。", + "description": "...", + "coverUrl": "https://cdn.hulalv.com/home/brand.jpg" + }, + "cards": [ + { + "title": "季节之旅", + "subtitle": "夏·秋·冬三季体验", + "coverUrl": "https://cdn.hulalv.com/cards/1.jpg" + } + ] + } +} +``` + +## 前端 Action + +### 管理端(必改) +1. 移除卡片编辑区底部"链接类型 *"下拉框组件 +2. 移除卡片编辑区"链接目标"相关组件(如产品选择器 / URL 输入框 / 小程序页面选择) +3. 请求体中 `cards[i]` 不再传 `linkType` / `linkTarget` + +### 小程序端(必改) +1. 主题卡片点击事件去除(卡片不再支持跳转) +2. 如果之前读了 `cards[i].linkType` / `.linkTarget` / `.linkTargetType` 的逻辑,一并删除 + +## 向后兼容说明 + +- DB 存量数据中的 JSON 字段 `linkType/linkTarget/linkTargetType` 不删,反序列化时被后端 `@JsonIgnoreProperties(ignoreUnknown=true)` 安全忽略 +- 前端如果旧请求仍传了这三个字段,后端也会被 `@JsonIgnoreProperties(ignoreUnknown=true)` 忽略(不会 400) +- 但**不推荐继续传**,清理前端代码更彻底 + +## 校验规则变化 + +| 字段 | 变化 | +|---|---| +| `cards[i].linkType` | 原 `@NotBlank + @Pattern(NONE/PRODUCT/PRODUCT_LINE/ARTICLE/URL/MINI_PAGE)` → **字段删除** | +| `cards[i].linkTarget` | 原 `@Length(max=500)` → **字段删除** | +| `cards` 数组 | 保留 `@Size(max=2)` | + +## 回归验证 + +部署后调 `GET /mp/home-config/screen2`,确认 `data.cards[i]` 只包含 title / subtitle / coverUrl 即可。 diff --git a/changelogs/2026-04/2026-04-18_mp-hotel-room-cover-fix.md b/changelogs/2026-04/2026-04-18_mp-hotel-room-cover-fix.md new file mode 100644 index 0000000..cd6367c --- /dev/null +++ b/changelogs/2026-04/2026-04-18_mp-hotel-room-cover-fix.md @@ -0,0 +1,52 @@ +# 小程序住宿详情 - 房型封面图 null 问题修复 + +- **日期**: 2026-04-18 +- **PR**: [#825](https://git.1814.love:8443/wx/HL/pulls/825) (Closes #824) +- **类型**: BUG FIX +- **状态**: 已合并到 dev + 测试环境部署中 + +--- + +## 影响接口 + +- `GET /mp/hotel/{hotelId}` (C 端住宿详情) + +## 现象 + +调用住宿详情返回的 `roomTypes` 数组中,**每个房型的 `coverUrl` 都是 null**(其他字段正常)。 + +```json +{ + "code": 200, + "data": { + "hotelId": "2023714929877450753", + "roomTypes": [ + { + "roomTypeId": "...", + "name": "豪华大床房", + "coverUrl": null, // 错误:应为 https://.../cover.jpg + "bannerUrls": [], // 错误:应为图片 URL 数组 + "videoUrl": null // 错误:应为视频 URL + } + ] + } +} +``` + +## 根因(仅供参考,前端无需关注) + +`RoomTypeService.listRoomTypes` 手动补救 `coverUrl` 时用 String 类型的 `coverMaterialId` 去查 `Map`,Java `HashMap.get` 不做类型转换导致永远返回 null。`banner/video` 的 materialId 同样未纳入批量查询。 + +## 修复后行为 + +- `roomTypes[i].coverUrl`:有封面素材时返回 https CDN URL +- `roomTypes[i].bannerUrls`:有横幅素材时返回 URL 数组(无素材的条目已 filter) +- `roomTypes[i].videoUrl`:有视频素材时返回 URL + +## 前端 Action + +**无需改代码**。后端修复后直接生效。 + +## 回归验证 + +测试环境部署完成后,调用 `GET /mp/hotel/{任一已上架酒店ID}` 检查 `roomTypes[0].coverUrl` 非 null 即可。