refactor(home-api): 统一首页API响应格式并迁移配套代码
完成首页数据模型的统一重构,具体变更如下: 1. 重构公共首页API接口,移除`playRecommendations`字段,将玩法推荐数据统一放入`experiences`字段 2. 更新前后端类型定义、序列化逻辑与前端页面组件,适配新的API响应结构 3. 为微信登录相关接口添加`trust_env=True`配置,支持企业代理环境并新增`socksio`依赖 4. 新增图片画廊上传组件,重构SingleImageUploader组件支持自定义宽高比 5. 重构Toast与Select组件的实现与样式,统一后台UI设计系统 6. 移除个人中心页面不必要的返回事件与顶部标题组件,优化详情卡片布局 7. 新增微信接口单元测试,更新官方文档与测试用例适配变更 8. 删除过期的文档图片资源
This commit is contained in:
1 parent
d3a246a873
commit
6296392e80
27 files changed
+1055
-218
No files matched your search
+3
-14
@@ -145,14 +145,13 @@ type PublicConciergeResponse = {
|
||||
|
||||
### `GET /api/public/home`
|
||||
|
||||
无需鉴权。接口只返回后台启用的首页体验推荐、团队共创和极境视界内容,按后台排序返回,不暴露管理元数据。
|
||||
无需鉴权。接口只返回后台启用的首页玩法推荐、团队共创和极境视界内容,按后台排序返回,不暴露管理元数据。为统一前台消费模型,玩法推荐列表放在 `experiences` 字段,响应中不再返回 `playRecommendations`。
|
||||
|
||||
```ts
|
||||
type PublicHomeResponse = {
|
||||
experiences: HomeExperience[];
|
||||
experiences: HomeWanfaRecommendation[];
|
||||
teamBuildings: HomeTeamBuilding[];
|
||||
wildArchives: HomeWildArchive[];
|
||||
playRecommendations: HomeWanfaRecommendation[];
|
||||
};
|
||||
|
||||
type HomeWanfaRecommendation = {
|
||||
@@ -171,16 +170,6 @@ type WanfaRoute = {
|
||||
demandKeyword: string;
|
||||
};
|
||||
|
||||
type HomeExperience = {
|
||||
id: string;
|
||||
badge: string;
|
||||
category: string;
|
||||
title: string;
|
||||
englishTitle: string;
|
||||
image: string;
|
||||
demandKeyword: string;
|
||||
};
|
||||
|
||||
type HomeTeamBuilding = {
|
||||
id: string;
|
||||
tag: string;
|
||||
@@ -204,7 +193,7 @@ type HomeWildArchive = {
|
||||
};
|
||||
```
|
||||
|
||||
无可用内容时,`experiences`、`teamBuildings`、`wildArchives` 和 `playRecommendations` 均返回空数组。玩法推荐由首页内容域关联玩法分类后生成,接口只返回启用的关联及分类当前路线;MiniAPP 接口失败或字段不完整时使用首页对应 fallback,玩法推荐缺省为空态。
|
||||
无可用内容时,`experiences`、`teamBuildings` 和 `wildArchives` 均返回空数组。`experiences` 实际承载首页玩法推荐,由首页内容域关联玩法分类后生成,接口只返回启用的关联及分类当前路线;MiniAPP 接口失败或字段不完整时使用对应空态,不再读取 `playRecommendations`。
|
||||
|
||||
客片案例更多列表使用 `GET /api/public/home/wild-archives`,返回同样的摘要字段;详情使用 `GET /api/public/home/wild-archives/{archiveId}`,在摘要字段基础上增加 `images: string[]`。首页卡片点击详情,`查看更多` 点击案例列表,不再跳转需求页。
|
||||
|
||||
|
||||
Reference in new issue
Block a user