功能描述
用于查看历史版本列表。
请求
请求示例
GET /api/v1/directory-history/{LibraryId}/{SpaceId}/history-list/{FilePath}?marker={Marker}&limit={Limit}&page={Page}&page_size={PageSize}&order_by={OrderBy}&order_by_type={OrderByType}&access_token={AccessToken}
请求参数
请求参数 | 描述 | 类型 | 是否必选 |
LibraryId | String | 是 | |
SpaceId | 空间 ID,如果媒体库为单租户模式,则该参数固定为连字符(-);如果媒体库为多租户模式,则必须指定该参数 | String | 是 |
FilePath | 文件路径,对于多级目录,使用斜杠( /)分隔,例如 foo/bar.txt | String | 是 |
Marker | 用于顺序列出分页的标识 | String | 否 |
Limit | 用于顺序列出分页时本地列出的项目数限制,默认为 20 若不指定任何翻页参数,默认采用(marker,limit)参数翻页 若与(page,page_size)参数同时使用,默认采用(page,page_size)参数翻页 | Int | 否 |
Page | 分页码,默认第一页 | Int | 否 |
PageSize | 分页大小,默认 20;若与(marker,limit)参数同时使用,默认采用(page,page_size)参数翻页 | Int | 否 |
OrderBy | 排序字段,按文件 id 排序为 id,按创建时间排序为 creationTime,默认为 id,最新版本排序始终在首位 | Int | 否 |
OrderByType | 排序方式,升序为 asc,降序为 desc,默认为 desc | String | 否 |
AccessToken | String | 是 |
请求体
该请求无请求体。
响应
响应码
获取成功,返回 HTTP 200 OK。
响应体
application/json
响应体示例:
{"totalNum": 2,"contents": [{"createdBy":"123","creationWay":1,"version":2,"isLatestVersion":true,"name": "test","size":2345,"crc64": "4937027024332829001","contentType": "image/png","creationTime": "2021-08-12T08:13:55.000Z","setLatestTime": "2021-08-12T08:13:55.000Z"},{"id":1,"createdBy":"456","creationWay":1,"version":2,"isLatestVersion":false,"name": "test","size":2300,"crc64": "8237027023432829000","contentType": "image/png","creationTime": "2021-08-12T08:13:54.000Z","setLatestTime": "2021-08-12T08:13:54.000Z"}]}
响应体字段说明:
响应参数 | 描述 | 类型 |
totalNum | 历史版本总数,采用 page 模式才会返回该字段 | Int |
hasMore | 是否有更多搜索结果 | Boolean |
nextMarker | 用于获取后续页的分页标识,仅当 hasMore 为 true 时才返回该字段 | String |
contents | 对象数组,目录或相簿内的具体内容 | Array |
contents 中包含以下内容:
响应参数 | 描述 | 类型 |
id | 历史版本 ID,最新历史版本不返回这一字段 | Int |
createdBy | 创建人 ID | String |
creationWay | 创建方式,0:创建,1:更新 | Int |
version | 版本号 | Int |
isLatestVersion | 是否最新版本 | Boolean |
name | 目录或相簿名或文件名 | String |
size | 历史版本文件大小 | Int |
crc64 | 文件的 CRC64-ECMA182 校验值,为了避免数字精度问题,这里为字符串格式 | String |
contentType | 文件元类型 | String |
creationTime | ISO 8601格式的日期与时间字符串,表示文件的创建时间,例如 2020-10-14T10:17:57.953Z | String |
setLatestTime | 设置为最新版本的时间,例如 2020-10-14T10:17:57.953Z | String |