Files
guke a563c1ca4b @ (#111)
docs/api目录文档分类和补全

---------

Co-authored-by: guke <guke@autohome.com.cn>
Reviewed-on: #111
2026-07-03 15:00:37 +08:00

31 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# POST /api/v1/meituan/coupons — 券列表 / 搜索
> 所属:美团 CPS 组(前缀 `/api/v1/meituan`,**全部无鉴权** | 鉴权:无 | [← 返回 API 索引](../README.md)
>
> 集成实现:见 [integrations/meituan](../integrations/meituan.md)CPS S-Ca 签名、入参换算坑)。
## 入参
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
| `longitude` | float | ✅ | — | 经度 |
| `latitude` | float | ✅ | — | 纬度 |
| `platform` | int | ❌ | 1 | 1=外卖/到家, 2=到店 |
| `biz_line` | int | ❌ | null | 到店子类:1到餐 2到综 3酒店 4门票 |
| `list_topic_id` | int | ❌ | 3 | 榜单:1精选 2今日必推 3爆款筛选 5限时筛选 |
| `keyword` | string | ❌ | null | 搜索词(**填了则忽略 `list_topic_id`,走搜索** |
| `sort_field` | int | ❌ | null | 1价格 2销量 6离我最近(搜索时默认 6) |
| `search_id` | string | ❌ | null | 翻页 token,首页不填 |
| `page` | int | ❌ | 1 | ≥1 |
| `page_size` | int | ❌ | 20 | 120 |
## 出参
响应 `200`:`{ items: CouponCard[], has_next: bool, search_id: string|null, status: "ok"|"empty"|"degraded" }``CouponCard` 结构见 [API 索引](./README.md#复用数据结构);`status` 语义见 [feed 接口](./meituan-feed.md#status-字段前端据此显示占位)。
## 错误码
无业务级错误码:未配凭证 / 美团调用失败都返 `200` + 空 `items` + `status=degraded`(**2026-06-10 起不再抛 502**,避免前端弹报错 toast)。
## 说明
- 当前 Android 客户端**未调用**此接口(搜索功能尚未实现),仅后端实现完整
- **统一软降级(2026-06-10)**:未配 `MT_CPS_APP_KEY/SECRET`、或已配但调美团失败,都返空 + `status=degraded`(此前后者抛 502);成功但无结果 → `status=empty`。前端按 `status` 显示「服务繁忙」/「暂无」,不再弹错误