zhibo/android-app/后端接口TODO清单-社交功能.md

143 lines
2.6 KiB
Markdown
Raw Normal View History

# 后端接口 TODO 清单 - 社交功能模块
## 1. 关注/取消关注主播
**文件**: `RoomDetailActivity.java`
**接口路径**: `POST /api/follow``DELETE /api/follow`
**请求参数**:
```json
{
"streamerId": "string",
"action": "follow|unfollow"
}
```
**返回数据**:
```json
{
"code": 200,
"data": {
"success": true,
"message": "string"
}
}
```
## 2. 获取关注列表
**文件**: `FollowingListActivity.java`
**接口路径**: `GET /api/users/{userId}/following`
**请求参数**:
- userId: 用户ID路径参数
- page (可选): 页码
- pageSize (可选): 每页数量
**返回数据**:
```json
{
"code": 200,
"data": [
{
"userId": "string",
"username": "string",
"avatarUrl": "string",
"bio": "string",
"isLive": "boolean"
}
]
}
```
## 3. 获取粉丝列表
**文件**: `FansListActivity.java`
**接口路径**: `GET /api/users/{userId}/fans`
**请求参数**: 同上
**返回数据**: 同上
## 4. 获取好友列表
**文件**: `MyFriendsActivity.java`
**接口路径**: `GET /api/users/{userId}/friends`
**请求参数**: 同上
**返回数据**: 同上
## 5. 添加好友
**文件**: `MyFriendsActivity.java`
**接口路径**: `POST /api/friends/add`
**请求参数**:
```json
{
"friendId": "string"
}
```
**返回数据**:
```json
{
"code": 200,
"data": {
"success": true
}
}
```
## 6. 删除好友
**文件**: `MyFriendsActivity.java`
**接口路径**: `DELETE /api/friends/{friendId}`
**请求参数**: friendId (路径参数)
**返回数据**:
```json
{
"code": 200,
"data": {
"success": true
}
}
```
## 7. 获取附近的人
**文件**: `MainActivity.java`
**接口路径**: `GET /api/users/nearby`
**请求参数**:
- latitude: 纬度
- longitude: 经度
- radius (可选): 半径公里默认10
**返回数据**:
```json
{
"code": 200,
"data": [
{
"userId": "string",
"username": "string",
"avatarUrl": "string",
"distance": "number",
"bio": "string"
}
]
}
```
## 8. 搜索好友
**文件**: `MyFriendsActivity.java`
**接口路径**: `GET /api/friends/search`
**请求参数**:
- userId: 当前用户ID从token中获取
- keyword: 搜索关键词
- page (可选): 页码
- pageSize (可选): 每页数量
**返回数据**:
```json
{
"code": 200,
"data": [
{
"userId": "string",
"username": "string",
"avatarUrl": "string",
"subtitle": "string",
"isOnline": "boolean",
"lastOnlineTime": "number"
}
]
}
```
**说明**:
- 搜索范围包括:好友昵称、备注、共同关注等
- 支持模糊搜索