a563c1ca4b
docs/api目录文档分类和补全 --------- Co-authored-by: guke <guke@autohome.com.cn> Reviewed-on: #111
40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
# GET /api/v1/platform/app-version — 最新 App 版本
|
||
|
||
> 所属:Platform 组(前缀 `/api/v1/platform`) | 鉴权:无 | [← 返回 API 索引](../README.md)
|
||
|
||
客户端启动 / 手动检查更新时拉取。用 `latest_version_code` 与本机 `versionCode` 比;未配置(返回默认 0)时客户端视为已是最新。
|
||
|
||
## 入参
|
||
|
||
无。
|
||
|
||
## 出参
|
||
|
||
响应 `200`:`AppVersionOut`
|
||
|
||
| 字段 | 类型 | 说明 |
|
||
|---|---|---|
|
||
| `latest_version_code` | int | 最新版 versionCode;0 = 未配置(无更新) |
|
||
| `latest_version_name` | string | 展示用版本号(如 `0.1.4`) |
|
||
| `apk_url` | string | 下载链接(发车产出的永久版本化链接) |
|
||
| `update_note` | string | 更新说明,弹窗展示(如「修复了部分机型闪退问题」) |
|
||
| `min_supported_version_code` | int | 本机低于此版本 = 强制更新;0 = 不强更(全可选) |
|
||
| `apk_size_bytes` | int | 包大小(字节),展示「约 x MB」 |
|
||
|
||
Mock 出参:
|
||
```json
|
||
{
|
||
"latest_version_code": 42,
|
||
"latest_version_name": "0.1.5",
|
||
"apk_url": "https://cdn.shaguabijia.com/releases/app-v0.1.5.apk",
|
||
"update_note": "1. 修复了部分机型闪退问题\n2. 优化了比价速度\n3. 新增省钱大作战功能",
|
||
"min_supported_version_code": 35,
|
||
"apk_size_bytes": 18350080
|
||
}
|
||
```
|
||
|
||
## 说明
|
||
- 不鉴权(版本信息非敏感,检查更新可能在登录前)
|
||
- `latest_version_code = 0` → 无更新,客户端无需提示
|
||
- `min_supported_version_code > 本机 versionCode` → 强制更新弹窗(不可跳过)
|