ai-c/docs/interest_partner_api.md

76 lines
1.8 KiB
Markdown
Raw 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.

# 兴趣搭子页面 API 接口文档
## 1. 获取页面素材 (Banner)
用于获取兴趣搭子页面的顶部 Banner 图片。
**接口地址:** `GET /api/page-assets`
**请求参数:**
| 参数名 | 类型 | 必填 | 说明 |
| :--- | :--- | :--- | :--- |
| group | string | 是 | 固定值: `interest_partner` |
**响应示例:**
```json
{
"success": true,
"code": 0,
"data": {
"banners": [
"/uploads/images/banner1.jpg",
"/uploads/images/banner2.jpg"
],
"banner": "/uploads/images/banner1.jpg, /uploads/images/banner2.jpg"
},
"message": "success"
}
```
**字段说明:**
* **优先读取 `banners` 数组字段。**
* 如果 `banners` 不存在,则尝试读取 `banner`、`interest_banner`、`top_banner` 字段。
* 支持单字符串字段包含逗号分隔的多张图片 URL`"url1, url2"`),前端会自动分割。
* 支持完整 URL (`https://...`) 或相对路径 (`/uploads/...`)。
---
## 2. 获取兴趣搭子列表 (现有)
**接口地址:** `GET /api/interest-partners`
**请求参数:**
| 参数名 | 类型 | 必填 | 说明 |
| :--- | :--- | :--- | :--- |
| page | number | 否 | 页码,默认 1 |
| limit | number | 否 | 每页数量 |
| city | string | 否 | 城市筛选 |
| category_id | number | 否 | 分类ID |
**响应示例:**
```json
{
"success": true,
"data": {
"list": [
{
"id": 1,
"name": "美食聚餐",
"description": "同城美食 共享美味",
"icon": "/images/icon-food.png",
"bg_color": "#FFF7ED",
"icon_color": "#FF7A45",
"member_count": "500+",
"qr_code": "/images/qr-food.jpg",
"group_name": "美食聚餐群",
"group_description": "加入我们一起寻找城市美味"
}
]
}
}
```