文档

收藏夹

收藏文件或文件夹相关方法。

说明

请求参数中的 options: IPDSRequestConfig 基于 axios 的 request config 封装,详情请看:AxiosRequestConfig

listStarredFiles 方法

调用同步接口获取收藏文件列表。

const result = await client.listStarredFiles(params, options)

参数说明

字段

类型

必选

说明

params

object

具体字段请查看 ICustomIndexKeyReq

options

IPDSRequestConfig

其它配置项

ICustomIndexKeyReq

字段

类型

必选

说明

drive_id

string

云盘

image_thumbnail_process

string

图片缩略图处理规则。

image_url_process

string

图片处理规则。

video_thumbnail_process

string

视频缩略图处理规则。

custom_index_key

string

自定义的key。

fields

string

文件类型,全部为 '*'

limit

number

返回结果数量

marker

string

标记

referer

string

地址,location.origin 或者 undefined

order_direction

string

可选值 'DESC' | 'ASC'

返回值

字段

类型

必选

说明

result

IListRes

返回结果

IListRes

字段

类型

必选

说明

items

IFileItem

文件列表,其中每一项可参考 listFiles 方法中 IFileItem 类型

next_marker

string

分页标记

batchToggleFilesStar 方法

批量收藏文件或者文件夹。

const result = await client.batchToggleFilesStar(fileItems, starred, options)

参数说明

字段

类型

必选

说明

fileItems

IFileItem[]

其中每一项请查看 listFiles方法中的 IFileItem 类型。

starred

boolean

为true表示收藏,为false表示取消收藏。

如果不传,fileItems中含有 starred 不为 true的时,默认为收藏,否则为取消收藏。

options

IPDSRequestConfig

其它配置项

返回值

字段

类型

必选

说明

result

object

返回结果

result

字段

类型

必选

说明

type

string

值为 star 或者 unStar

changeItems

array

未收藏的文件信息

successItems

array

成功的结果列表

errorItems

array

失败的结果列表

  • 本页导读 (0)
文档反馈