From 471ebd9d6cb85095bdc48561a5875e322f70a630 Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Sat, 18 Apr 2026 11:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=A8=A1=E5=9D=97=E5=AF=B9=E6=8E=A5=E6=96=B9?= =?UTF-8?q?=E6=A1=88=20(Banner/Contact/FAQ/Agreement)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6-04-18_mp-config-module-frontend-guide.md | 410 ++++++++++++++++++ 1 file changed, 410 insertions(+) create mode 100644 changelogs/2026-04/2026-04-18_mp-config-module-frontend-guide.md diff --git a/changelogs/2026-04/2026-04-18_mp-config-module-frontend-guide.md b/changelogs/2026-04/2026-04-18_mp-config-module-frontend-guide.md new file mode 100644 index 0000000..bb2599c --- /dev/null +++ b/changelogs/2026-04/2026-04-18_mp-config-module-frontend-guide.md @@ -0,0 +1,410 @@ +# 小程序配置模块对接方案 + +> 模块:小程序配置 (Banner 首页配置 / 我的页面配置 / 协议政策 / FAQ) +> 后端服务:hl-user-service(Admin + Internal)+ hl-mp-service(小程序透传) +> 文档日期:2026-04-18 +> 适用:dev 分支当前代码(PR #773 整改后) + +--- + +## 0. 通用约定(必读) + +### 0.1 响应包装 `Result` +```json +{ + "code": 200, // 200=成功;非 200=业务异常(HTTP 始终 200) + "message": "成功", + "data": { ... } +} +``` +**所有接口 HTTP 状态码始终是 200**,业务成败看 `code`。401 = 未登录/Token 过期;403 = 无权限;500 = 业务/系统异常。 + +### 0.2 分页响应 `PageResult` +```json +{ "records": [...], "total": 0, "page": 1, "pageSize": 20 } +``` +分页请求统一字段:`page`(默认 1,≥1)、`pageSize`(默认 20,1~100)。 + +### 0.3 Long ID 序列化 +所有 Long 类型 ID 通过 `@JsonSerialize(ToStringSerializer)` 序列化为 **字符串**(防 JS 大数精度丢失)。前端接收/回传统一按字符串处理。 + +### 0.4 富文本 XSS 过滤 +`content`/`answer` 字段后端会经 `XssUtils` 过滤: +- 禁用:`