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

3.2 KiB
Raw Blame History

后端接口 TODO 清单 - 其他功能模块

1. 记录观看历史

文件: RoomDetailActivity.java 接口路径: POST /api/watch/history 请求参数:

{
  "userId": "string",
  "roomId": "string",
  "watchTime": "number"
}

返回数据:

{
  "code": 200,
  "data": {
    "success": true
  }
}

2. 获取观看历史列表

文件: WatchHistoryActivity.java 接口路径: GET /api/watch/history 请求参数:

  • userId: 用户ID从token中获取
  • page (可选): 页码
  • pageSize (可选): 每页数量 返回数据:
{
  "code": 200,
  "data": [
    {
      "roomId": "string",
      "title": "string",
      "streamerName": "string",
      "coverUrl": "string",
      "watchTime": "number"
    }
  ]
}

3. 获取通知列表

文件: NotificationsActivity.java 接口路径: GET /api/notifications 请求参数:

  • userId: 用户ID从token中获取
  • type (可选): 通知类型system/interaction/follow/message/live
  • page (可选): 页码
  • pageSize (可选): 每页数量 返回数据:
{
  "code": 200,
  "data": [
    {
      "id": "string",
      "type": "string",
      "title": "string",
      "content": "string",
      "isRead": "boolean",
      "timestamp": "number"
    }
  ]
}

4. 标记通知为已读

文件: NotificationsActivity.java 接口路径: POST /api/notifications/{notificationId}/read 请求参数: notificationId (路径参数) 返回数据:

{
  "code": 200,
  "data": {
    "success": true
  }
}

5. 获取分类列表

文件: MainActivity.java 接口路径: GET /api/categories 返回数据:

{
  "code": 200,
  "data": [
    {
      "id": "string",
      "name": "string",
      "icon": "string"
    }
  ]
}

6. 按分类获取直播间列表

文件: MainActivity.java 接口路径: GET /api/rooms?category={categoryId} 请求参数:

  • category: 分类ID
  • page (可选): 页码
  • pageSize (可选): 每页数量 返回数据: 同获取直播间列表接口

7. 获取推荐内容

文件: MainActivity.java 接口路径: GET /api/recommend 请求参数:

  • userId: 用户ID从token中获取可选
  • type: 推荐类型room/user 返回数据:
{
  "code": 200,
  "data": [
    {
      "id": "string",
      "title": "string",
      "coverUrl": "string",
      "type": "string"
    }
  ]
}

8. 删除观看历史

文件: WatchHistoryActivity.java 接口路径: DELETE /api/watch/history/{historyId} 请求参数: historyId (路径参数) 返回数据:

{
  "code": 200,
  "data": {
    "success": true
  }
}

9. 清空观看历史

文件: WatchHistoryActivity.java 接口路径: DELETE /api/watch/history/clear 请求参数: userId从token中获取 返回数据:

{
  "code": 200,
  "data": {
    "success": true
  }
}

10. 删除通知

文件: NotificationsActivity.java 接口路径: DELETE /api/notifications/{notificationId} 请求参数: notificationId (路径参数) 返回数据:

{
  "code": 200,
  "data": {
    "success": true
  }
}

说明: 此接口已在通知推送模块中定义