# 更新资源合集版本
# 调用方式: PUT
# 接口地址:
https://api.freelog.com/v2/resources/catalogue/{resourceId}
1
# url传入参数说明:
参数 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
resourceId | 必选 | 资源ID | 合集目前固定版本,所以无需传递版本号,只需要资源ID |
# body传入参数说明:
参数 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
description | 可选 | string | 版本描述信息 |
dependencies | 可选 | object[] | 版本依赖信息(如果需要变更依赖,则需要传递全量数据) |
**resourceId | 必选 | string | 依赖的资源ID |
**versionRange | 必选 | string | 依赖的资源版本范围 |
customPropertyDescriptors | 可选 | object[] | 版本自定义属性定义 |
** key | 必选 | string | 自定义属性名称 |
** defaultValue | 必选 | string | 自定义属性对应的值 |
** type | 必选 | string | 属性类型(与资源版本接口的自定义属性一致) |
** candidateItems | 可选 | string[] | 选项列表,单选,多选,下拉选择时需要提供选项 |
** remark | 可选 | string | 字段说明 |
resolveResources | 可选 | object[] | 依赖以及依赖的上抛授权解决方式 |
** resourceId | 必选 | string | 解决的资源ID |
** contracts | 必选 | object[] | 解决所用的合同信息 |
**** policyId | 必选 | string | 策略ID |
catalogueProperty | 可选 | object | 资源合集特有的属性 |
**collection_item_no_display | 可选 | string | 值为collection_item_no_display_show或collection_item_no_display_hide |
**collection_item_image_display | 可选 | string | 值为collection_item_image_display_show或collection_item_image_display_hide |
**collection_item_descr_display | 可选 | string | 值为collection_item_descr_display_show或collection_item_descr_display_hide |
**collection_view | 可选 | string | 值为collection_view_list或collection_view_card |
isMergeCatalogueDraft | 可选 | int | 是否合并目录草稿(0:不合并 1:合并) 前端需要记录目录是否发生变动,因为草稿合并比较消耗资源 |
资源合集相关的属性catalogueProperty参考文档:https://freelog.yuque.com/org-wiki-freelog-qqxqll/gkva0w/rupov7xgdy5rxr50?inner=Q09Zp
1
# body示例
{
"description": "description",
"dependencies": [{
"resourceId": "64462e9769a661002ebe1e1a",
"versionRange": "0.1.24"
}],
"resolveResources": [{
"resourceId": "64462e9769a661002ebe1e1a",
"contracts": [{
"policyId": "f182dbabc6e4b24e88a9d1998cb13589"
}]
}],
"catalogueProperty": {
"collection_item_no_display": "collection_item_no_display_show",
"collection_item_image_display": "collection_item_image_display_show",
"collection_item_descr_display": "collection_item_descr_display_hide",
"collection_view": "collection_view_list"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 返回说明:
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
resourceId | string | 资源ID |
resourceType | string | 资源类型[[详见附表]][资源类型] |
resourceName | string | 资源名称 |
userId | int | 用户ID |
description | string | 资源描述信息 |
version | string | 版本号 |
versionId | string | 版本ID |
fileSha1 | string | 资源sha1值 |
dependencies | object[] | 资源依赖信息 |
**resourceId | string | 依赖的资源ID |
**resourceName | string | 依赖的资源名称 |
**versionRange | string | 依赖的资源版本范围 |
upcastResources | object[] | 真实上抛资源列表,资源的基础上抛子集 |
** resourceId | string | 上抛资源ID |
** resourceName | string | 上抛资源名称 |
resolveResources | object[] | 版本解决的依赖以及上抛 |
** resourceId | string | 解决的资源ID |
** contracts | object[] | 解决所用的合同信息 |
**** policyId | string | 策略ID |
**** contractId | string | 合同ID |
systemProperty | object | 系统属性 |
customProperty | object | 自定义系统属性(根据描述器自动生成的) |
customPropertyDescriptors | object[] | 自定义属性描述器 |
** key | string | 自定义属性名称 |
** defaultValue | string | 自定义属性对应的值 |
** type | string | 属性类型(editableText:可编辑文本,readonlyText:只读文本,radio:单选,checkbox:多选,select:下拉选项) |
** candidateItems | string[] | 选项列表,单选,多选,下拉选择时需要提供选项 |
** remark | string | 字段说明 |
createDate | date | 创建日期 |
catalogueProperty | object | 资源合集相关的特有属性 |
optionalResolveResources | object[] | 资源合集中单品以及其上抛的授权解决方式 |
** resourceId | string | 解决的资源ID |
** contracts | object[] | 解决所用的合同信息 |
**** policyId | string | 策略ID |
**** contractId | string | 合同ID |
optionalDependencies | object[] | 资源依赖信息 |
**resourceId | string | 依赖的资源ID |
**resourceName | string | 依赖的资源名称 |
**versionRange | string | 依赖的资源版本范围 |
# 返回示例
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"resourceType": [
"阅读",
"文章"
],
"description": "description",
"catalogueProperty": {
"collection_item_no_display": "collection_item_no_display_show",
"collection_item_image_display": "collection_item_image_display_show",
"collection_item_descr_display": "collection_item_descr_display_hide",
"collection_view": "collection_view_list"
},
"status": 0,
"version": "0.0.1",
"filename": null,
"fileSha1": null,
"resourceId": "66728ed4392531049c056177",
"resourceName": "yuliang/collection-resource",
"userId": 50017,
"resourceTypeCode": "RT003001",
"dependencies": [
{
"resourceId": "64462e9769a661002ebe1e1a",
"versionRange": "0.1.24",
"resourceName": "ZhuC/podcast-theme"
}
],
"resolveResources": [
{
"resourceId": "64462e9769a661002ebe1e1a",
"contracts": [
{
"policyId": "f182dbabc6e4b24e88a9d1998cb13589",
"contractId": "6673cbc074c44e002fd4e5bb",
"authStatus": 1
}
],
"resourceName": "ZhuC/podcast-theme"
}
],
"optionalResolveResources": [
{
"resourceId": "61b01337db219c002f64f39c",
"contracts": [
{
"policyId": "f182dbabc6e4b24e88a9d1998cb13589",
"contractId": "6673eba874c44e002fd4edfc",
"authStatus": 1
}
]
}
],
"upcastResources": [],
"systemProperty": {},
"systemPropertyDescriptors": [],
"customPropertyDescriptors": [],
"versionId": "b63fcfff4483cf6b00daeda90e0193a8",
"resolveResourceAuthStatus": 1,
"optionalDependencies": [
{
"resourceId": "61b01337db219c002f64f39c",
"resourceName": "yuliang/tt",
"versionRange": "*"
}
],
"createDate": "2024-06-19T07:55:00.621Z",
"updateDate": "2024-06-24T06:32:17.959Z",
"customProperty": {}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75