对号 jo!
  1. 三、应用模块接口
对号 jo!
  • 一、项目说明
  • 二、接口说明
  • 三、应用模块接口
    • 3.1 系统相关API
    • 3.2 网盘文件API
    • 3.3 媒体相关API
    • 3.4 资源相关API
    • 3.5 用户相关API
    • 3.6 分享管理API
  • 四、开发说明
    • 4.1 技术开发总述
    • 4.2 通用数据库接口说明
    • 4.3 前端 API 调用示例
    • 4.3 后端API实现
  1. 三、应用模块接口

3.6 分享管理API

3.6 分享管理 API#

3.6.1 创建分享#

URL:/share/create
方法:POST
参数:
{
  "file_id": "file_123",         // 文件 ID
  "share_type": "public",        // 分享类型:public, private
  "password": "123456",          // 分享密码(可选)
  "expire_time": "2024-12-31",   // 过期时间(可选)
  "title": "分享的文件"           // 分享标题(可选)
}
返回数据:
{
  "code": 200,
  "message": "成功",
  "data": {
    "share_id": "share_123",
    "share_url": "http://example.com/share/share_123",
    "expire_time": "2024-12-31",
    "password": "123456"
  }
}

3.6.2 验证分享#

URL:/share/verify/{shareUrl} 或 /share/verify/{shareUrl}/{password}
方法:GET
参数:
shareUrl:分享 URL 或分享 ID
password:分享密码(可选)
返回数据:
{
  "code": 200,
  "message": "成功",
  "data": {
    "valid": true,
    "share": {
      "id": "share_123",
      "file_id": "file_123",
      "file_name": "分享的文件.jpg",
      "share_type": "public",
      "expire_time": "2024-12-31",
      "created_at": "2024-01-01 00:00:00"
    }
  }
}

3.6.3 获取分享列表#

URL:/share/list
方法:GET
参数:无
返回数据:
{
  "code": 200,
  "message": "成功",
  "data": {
    "shares": [
      {
        "id": "share_123",
        "file_id": "file_123",
        "file_name": "分享的文件.jpg",
        "share_url": "http://example.com/share/share_123",
        "share_type": "public",
        "expire_time": "2024-12-31",
        "created_at": "2024-01-01 00:00:00"
      }
    ]
  }
}

3.6.4 取消分享#

URL:/share/cancel/{shareId}
方法:DELETE
参数:
shareId:分享 ID
返回数据:
{
  "code": 200,
  "message": "成功",
  "data": {
    "success": true
  }
}
修改于 2026-01-21 20:47:50
上一页
3.5 用户相关API
下一页
4.1 技术开发总述
Built with