创建资源类型 /v2/resources/types/create POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 | 是 |
name | string | 名称 | 是 |
parentCode | string | 父类型编号,没有父类型填空字符串 | 是 |
formats | string[] | 格式数组 | 否 |
attrs | string[] | 属性数组 | 否 |
priority | number | 权重 | 是 |
status | number | 状态 1:开启 2:停用 | 是 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 | 是 |
startTime | Date | 开启时间 | 否 |
resourceConfig | obj | 资源相关配置 | 否 |
**supportCreateBatch | number | 是否支持批量创建资源 1:不支持 2:支持 | 是 |
**resourceCategory | number | 标的物类型 1:独立资源 2:集合资源 | 是 |
**fileCommitMode | number[] | 2^ 0:本地上传 1:从存储空间导入 2:文档编辑器 3:漫画排板工具 4:集合单品管理工具 | 是 |
**fileMaxSize | number | 文件大小 | 是 |
**fileMaxSizeUnit | number | 文件大小单位 1:MB 2:GB | 是 |
**supportDownload | number | 是否支持下载 1:不支持 2:支持 | 是 |
**supportEdit | number | 是否支持编辑 1:不支持 2:支持 | 是 |
**autoGenerateCover | number | 是否自动生成封面 1:不支持 2:支持 | 是 |
**supportOptionalConfig | number | 是否支持可选配置 1:不支持 2:支持 | 是 |
presentableConfig | number | 展品相关配置 | 是 |
**versionShowMode | number | 展示模式 1: 自动更新到最新版本 2:手动更新到最新版本 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
2
3
4
5
6
7
列出资源类型 /v2/resources/types/list GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
skip | number | 跳过的数目 | 是 |
limit | number | 查询的数目,填0表示查所有 | 是 |
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 | 否 |
status | number | 状态 1:启用 2:停用 | 否 |
parentCode | string | 父类型编号 | 否 |
codeOrName | string | 编号或者名称 | 否 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 | 否 |
supportCreateBatch | number | 是否支持批量 1:不支持 2:支持 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"num": 1,
"resourceTypes": {
"skip": 0,
"limit": 0,
"totalItem": 1,
"dataList": [
{
"parentCode": "",
"formats": [
""
],
"attrs": [
"mime",
"fileSize"
],
"resourceCount": 294,
"isTerminate": true,
"resourceConfig": {
"supportCreateBatch": 2
},
"_id": "6414349dcbdff544045e754d",
"code": "RT001",
"name": "主题",
"priority": 1,
"status": 1,
"category": 1,
"createDate": "2023-03-17T09:36:29.724Z",
"updateDate": "2023-11-09T08:49:55.760Z",
"startTime": null
}
]
}
}
}
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
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 |
parentCode | string | 父类型编号 |
parentName | string | 父类型名称 |
formats | string[] | 格式数组 |
attrs | string[] | 属性数组 |
resourceCount | number | 关联资源数量 |
code | string | 编号 |
name | string | 名称 |
priority | number | 权重 |
status | number | 状态 1:开启 2:停用 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 |
startTime | Date | 开启时间 |
resourceConfig | object | 资源相关配置 |
**supportCreateBatch | number | 是否支持批量 1:不支持 2:支持 |
编辑资源类型 /v2/resources/types/update POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 | 是 |
code | string | 资源类型编号 | 是 |
name | string | 名称 | 是 |
parentCode | string | 父类型编号 | 是 |
formats | string[] | 格式数组 | 是 |
attrs | string[] | 属性数组 | 是 |
priority | number | 权重 | 是 |
status | number | 状态 1:开启 2:停用 | 是 |
startTime | Date | 开启时间 | 否 |
resourceConfig | obj | 资源相关配置 | 否 |
**supportCreateBatch | number | 是否支持批量创建资源 1:不支持 2:支持 | 是 |
**resourceCategory | number | 标的物类型 1:独立资源 2:集合资源 | 是 |
**fileCommitMode | number[] | 2^ 0:本地上传 1:从存储空间导入 2:文档编辑器 3:漫画排板工具 4:集合单品管理工具 | 是 |
**fileMaxSize | number | 文件大小 | 是 |
**fileMaxSizeUnit | number | 文件大小单位 1:MB 2:GB | 是 |
**supportDownload | number | 是否支持下载 1:不支持 2:支持 | 是 |
**supportEdit | number | 是否支持编辑 1:不支持 2:支持 | 是 |
**autoGenerateCover | number | 是否自动生成封面 1:不支持 2:支持 | 是 |
**supportOptionalConfig | number | 是否支持可选配置 1:不支持 2:支持 | 是 |
presentableConfig | number | 展品相关配置 | 是 |
**versionShowMode | number | 展示模式 1: 自动更新到最新版本 0:手动更新到最新版本 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
2
3
4
5
6
7
简单根据父类型列出资源类型 /v2/resources/types/listSimpleByParentCode GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
parentCode | string | 父类型编号 | 否 |
name | string | 名称(模糊匹配) | 否 |
category | number | 分类 1:基础类型 2:自定义类型 | 否 |
excludeParentCode | boolean | 是否排除指定的父类型编号 | 否 |
isTerminate | boolean | 是否是叶子节点 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": [
{
"resourceCount": 0,
"_id": "64197c0895b75601f4a2913e",
"code": "CRT006000001",
"name": "抖音小视频"
},
{
"resourceCount": 9,
"_id": "6414349ecbdff544045e75b1",
"code": "RT006003",
"name": "短视频"
},
{
"resourceCount": 2,
"_id": "6414349ecbdff544045e75b8",
"code": "RT006004",
"name": "长视频"
}
]
}
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
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
code | string | 资源类型编号 |
name | string | 名称 |
resourceCount | number | 资源依赖数 |
string | 备注 |
取某资源类型的属性 /v2/resources/types/getAttrsByCode GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
code | string | 资源类型编号 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": [
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dbfc",
"group": 1,
"name": "大小",
"key": "file_size",
"createDate": "2023-02-20T08:35:03.925Z",
"updateDate": "2023-02-27T09:34:24.969Z"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
name | string | 名称 |
note | string | 备注 |
key | string | 键 |
format | number | 值格式 1:文本 2:数值 3:时间 4:日期 5:日期和时间 |
insertMode | number | 录入方式 1:系统解析 |
dependencies | number | 依赖数 |
启用,暂停某个资源类型 /v2/resources/types/updateStatus POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
code | string | 资源类型编号 | 是 |
status | number | 状态 1:启用 2:暂停 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
2
3
4
5
6
7
批量启用,暂停资源类型 /v2/resources/types/updateStatusBatch POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
codes | string[] | 资源类型编号数组 | 是 |
status | number | 状态 1:启用 2:暂停 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
2
3
4
5
6
7
根据编号取资源类型 /v2/resources/types/getInfoByCode GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
code | string | 资源类型编号 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"code": "RT001",
"name": "主题",
"parentCode": "",
"parentInfo": {
"parentCodeChain": [
"RT001"
],
"parentChain": [
{
"code": "RT001",
"name": "主题"
}
]
},
"formats": [
""
],
"attrs": [
{
"_id": "642fda187bf57c0284bee5bb",
"name": "格式",
"key": "mime"
},
{
"_id": "642fda187bf57c0284bee5be",
"name": "大小",
"key": "fileSize"
}
],
"resourceCount": 294,
"priority": 1,
"status": 1,
"category": 1,
"startTime": null,
"isTerminate": true,
"resourceConfig": {
"supportCreateBatch": 2,
"resourceCategory": 1,
"fileCommitMode": 3,
"fileMaxSize": 200,
"fileMaxSizeUnit": 1,
"supportDownload": 1,
"supportEdit": 1,
"autoGenerateCover": 1,
"supportOptionalConfig": 1
},
"presentableConfig": {
"versionShowMode": 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
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 |
parentCode | string | 父类型编号 |
parentName | string | 父类型名称 |
formats | string[] | 格式数组 |
attrs | string[] | 属性数组 |
resourceCount | number | 关联资源数量 |
code | string | 编号 |
name | string | 名称 |
priority | number | 权重 |
status | number | 状态 1:开启 2:停用 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 |
startTime | Date | 开启时间 |
isTerminate | boolean | 是否是叶子节点 |
resourceConfig | obj | 资源相关配置 |
**supportCreateBatch | number | 是否支持批量创建资源 1:不支持 2:支持 |
**resourceCategory | number | 标的物类型 1:独立资源 2:集合资源 |
**fileCommitMode | number[] | 2^ 0:本地上传 1:从存储空间导入 2:文档编辑器 3:漫画排板工具 4:集合单品管理工具 |
**fileMaxSize | number | 文件大小 |
**fileMaxSizeUnit | number | 文件大小单位 1:MB 2:GB |
**supportDownload | number | 是否支持下载 1:不支持 2:支持 |
**supportEdit | number | 是否支持编辑 1:不支持 2:支持 |
**autoGenerateCover | number | 是否自动生成封面 1:不支持 2:支持 |
**supportOptionalConfig | number | 是否支持可选配置 1:不支持 2:支持 |
presentableConfig | number | 展品相关配置 |
**versionShowMode | number | 展示模式 1: 自动更新到最新版本 0:手动更新到最新版本 |
根据编号取资源类型 /v2/resources/types/getInfoByCodeOrName GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
code | string | 资源类型编号 | 否 |
name | string | 资源类型名称 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"code": "RT0005",
"name": "摄影",
"parentCode": "RT0004",
"formats": [
".jpg",
".png"
],
"attrs": [
"file_size",
"mime"
],
"priority": 2,
"status": 2,
"category": 1,
"startTime": "2023-02-19T16:00:00.000Z",
"parentName": "图片"
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 |
parentCode | string | 父类型编号 |
parentName | string | 父类型名称 |
note | string | 备注 |
formats | string[] | 格式数组 |
attrs | string[] | 属性数组 |
resourceCount | number | 关联资源数量 |
code | string | 编号 |
name | string | 名称 |
priority | number | 权重 |
status | number | 状态 1:开启 2:停用 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 |
startTime | Date | 开启时间 |
列出资源类型简单的(存在父子关系,但将结构拍平) /v2/resources/types/listSimple GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 | 否 |
codeOrName | string | 编号或者名称 | 否 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 | 否 |
sortOptions | string | 排序字段,用逗号分隔 | 否 |
codes | string | 编号数组 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": [
{
"code": "RT0004",
"parentCode": "",
"name": "图片",
"resourceCount": 0,
"priority": 1,
"category": 1,
"children": [
{
"code": "RT0004002",
"parentCode": "RT0004",
"name": "摄影6",
"resourceCount": 0,
"priority": 100,
"category": 1,
"children": [
{
"code": "RT0004002001",
"parentCode": "RT0004002",
"name": "图片2",
"resourceCount": 0,
"priority": 100,
"category": 1,
"children": [
{
"code": "RT0004002001001",
"parentCode": "RT0004002001",
"name": "玩具",
"resourceCount": 0,
"priority": 10,
"category": 1,
"children": []
}
]
}
]
}
]
},
{
"code": "RT0006",
"parentCode": "",
"name": "test",
"resourceCount": 0,
"priority": 2,
"category": 1,
"children": [
{
"code": "RT0007",
"parentCode": "RT0006",
"name": "test1",
"resourceCount": 0,
"priority": 4,
"category": 1,
"children": [
{
"code": "RT0008",
"parentCode": "RT0007",
"name": "test11",
"resourceCount": 0,
"priority": 5,
"category": 1,
"children": [
{
"code": "RT0008001",
"parentCode": "RT0008",
"name": "test111",
"resourceCount": 0,
"priority": 6,
"category": 1,
"children": []
}
]
}
]
}
]
}
]
}
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
76
77
78
79
80
81
82
83
84
85
86
列出资源类型分组排序 /v2/resources/types/listSimpleByGroup GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 | 否 |
codeOrName | string | 编号或者名称 | 否 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 | 否 |
sortOptions | string | 排序字段,用逗号分隔 | 否 |
status | number | 1:启用 2:停用 | 否 |
supportCreateBatch | number | 是否支持批量 1:不支持 2:支持 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": [
{
"code": "RT0004",
"parentCode": "",
"name": "图片",
"resourceCount": 0,
"priority": 1,
"category": 1,
"children": [
{
"code": "RT0004002",
"parentCode": "RT0004",
"name": "摄影6",
"resourceCount": 0,
"priority": 100,
"category": 1,
"children": [
{
"code": "RT0004002001",
"parentCode": "RT0004002",
"name": "图片2",
"resourceCount": 0,
"priority": 100,
"category": 1,
"children": [
{
"code": "RT0004002001001",
"parentCode": "RT0004002001",
"name": "玩具",
"resourceCount": 0,
"priority": 10,
"category": 1,
"children": []
}
]
}
]
}
]
},
{
"code": "RT0006",
"parentCode": "",
"name": "test",
"resourceCount": 0,
"priority": 2,
"category": 1,
"children": [
{
"code": "RT0007",
"parentCode": "RT0006",
"name": "test1",
"resourceCount": 0,
"priority": 4,
"category": 1,
"children": [
{
"code": "RT0008",
"parentCode": "RT0007",
"name": "test11",
"resourceCount": 0,
"priority": 5,
"category": 1,
"children": [
{
"code": "RT0008001",
"parentCode": "RT0008",
"name": "test111",
"resourceCount": 0,
"priority": 6,
"category": 1,
"children": []
}
]
}
]
}
]
}
]
}
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
76
77
78
79
80
81
82
83
84
85
86
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
subjectType | number[] | 标的物类型 1:资源标的物 2:集合标的物 |
parentCode | string | 父类型编号 |
resourceCount | number | 关联资源数量 |
code | string | 编号 |
name | string | 名称 |
note | string | 备注 |
priority | number | 权重 |
category | number | 种类 1:基础资源类型 2:自定义资源类型 |
children | {}[] | 子类型数组 |
修改权重 /v2/resources/types/updatePriority POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
code | string | 资源类型编号 | 是 |
priority | number | 权重 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
2
3
4
5
6
7
简单列出最近使用的资源类型 /v2/resources/types/listSimple4Recently GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
isMine | boolean | 是否是自己的 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": [
{
"_id": "6414349dcbdff544045e754d",
"code": "RT001",
"name": "主题"
},
{
"_id": "6414349dcbdff544045e7559",
"code": "RT003",
"name": "阅读"
},
{
"_id": "6414349dcbdff544045e7560",
"code": "RT003001",
"name": "文章"
},
{
"_id": "6414349dcbdff544045e756d",
"code": "RT004",
"name": "音频"
},
{
"_id": "6414349dcbdff544045e757b",
"code": "RT004002",
"name": "音乐"
},
{
"_id": "6414349ecbdff544045e7588",
"code": "RT005",
"name": "图片"
},
{
"_id": "6414349ecbdff544045e758f",
"code": "RT005001",
"name": "照片"
},
{
"_id": "6414349ecbdff544045e7596",
"code": "RT005002",
"name": "插画"
},
{
"_id": "6414349ecbdff544045e759c",
"code": "RT006",
"name": "视频"
},
{
"_id": "6414349ecbdff544045e75b1",
"code": "RT006003",
"name": "短视频"
}
]
}
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
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
code | string | 资源类型编号 |
name | string | 名称 |
resourceCount | number | 资源依赖数 |
← 资源属性接口文档_补充 运营分类接口文档 →