Skip to content

file ​

5 个操作。返回索引见 本目录索引。

DELETE /api/v1/files ​

批量删除文件

  • operationId:deleteFiles
  • 鉴权:sessionCookie 或 bearerToken
  • 标签:file

参数 ​

名称位置必填类型说明
idsquery是string逗号分隔的文件 ID。

响应 ​

状态说明内容
200删除结果application/json object
400请求不合法。application/json Error
401未认证或凭据失效。application/json Error
403无权访问。application/json Error

200 ​

结构示例(由 schema 自动推导,字段值为占位符):

json
{
  "data": {
    "deleted_count": 1
  }
}

400 ​

401 ​

403 ​

GET /api/v1/files ​

文件列表

  • operationId:listFiles
  • 鉴权:sessionCookie 或 bearerToken
  • 标签:file

参数 ​

名称位置必填类型说明
limitquery否integer每页条数,1..200,默认 20。
cursorquery否string上一页返回的 next_cursor;首次请求省略。
findquery否string-
categoryquery否string-
timequery否integer,枚举:-1 / 1-
sizequery否integer,枚举:-1 / 1-

响应 ​

状态说明内容
200文件页application/json object
401未认证或凭据失效。application/json Error

200 ​

  • application/json:object

结构示例(由 schema 自动推导,字段值为占位符):

json
{
  "data": {
    "items": [
      {
        "created_at": "2026-01-01T00:00:00Z",
        "id": "00000000-0000-0000-0000-000000000000",
        "kind": "string",
        "mime": "string",
        "size_bytes": 1,
        "title": "string",
        "updated_at": "2026-01-01T00:00:00Z",
        "url": "string"
      }
    ]
  }
}

401 ​

POST /api/v1/files ​

上传普通文件

  • operationId:uploadFile
  • 鉴权:sessionCookie 或 bearerToken
  • 标签:file

请求体 ​

必填:是。

  • multipart/form-data:object
    • category_id:integer (int64)
    • file:string (binary),必填
    • title:string

结构示例(由 schema 自动推导,字段值为占位符):

json
{
  "file": "string"
}

响应 ​

状态说明内容
201已上传application/json object
400请求不合法。application/json Error
401未认证或凭据失效。application/json Error
403无权访问。application/json Error
413语义校验失败。application/json Error

201 ​

  • application/json:object

结构示例(由 schema 自动推导,字段值为占位符):

json
{
  "data": {
    "created_at": "2026-01-01T00:00:00Z",
    "id": "00000000-0000-0000-0000-000000000000",
    "kind": "string",
    "mime": "string",
    "size_bytes": 1,
    "title": "string",
    "updated_at": "2026-01-01T00:00:00Z",
    "url": "string"
  }
}

400 ​

401 ​

403 ​

413 ​

DELETE /api/v1/files/{id} ​

删除文件

  • operationId:deleteFile
  • 鉴权:sessionCookie 或 bearerToken
  • 标签:file

参数 ​

名称位置必填类型说明
idpath是string (uuid)-

响应 ​

状态说明内容
204已删除-
401未认证或凭据失效。application/json Error
403无权访问。application/json Error
404资源不存在。application/json Error

401 ​

403 ​

404 ​

GET /api/v1/files/{id}/content ​

下载文件内容

  • operationId:downloadFileContent
  • 鉴权:sessionCookie 或 bearerToken
  • 标签:file

参数 ​

名称位置必填类型说明
idpath是string (uuid)-

响应 ​

状态说明内容
200文件流application/octet-stream string (binary)
401未认证或凭据失效。application/json Error
403无权访问。application/json Error
404资源不存在。application/json Error

200 ​

  • application/octet-stream:string (binary)

结构示例(由 schema 自动推导,字段值为占位符):

json
"string"

401 ​

403 ​

404 ​

Released under the MIT License.