创建资源属性 /v2/resources/attrs/create POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
name | string | 名称 | 是 |
note | string | 备注 | 否 |
key | string | 键 | 是 |
format | number | 值格式 1:文本 2:数值 3:时间 4:日期 5:日期和时间 6:单行文本 7:多行文本 8:整数 9:小数 | 是 |
formatUnit | string | 格式单位 | 否 |
autoConvert | boolean | 是否自动转换 | 否 |
insertMode | number | 录入方式 1:系统解析 2:自定义输入 | 是 |
contentRule | {} | 值验证规则 | 否 |
contentRule
{
minLength:integer, // 字串最小长度
maxLength:integer, // 字串最大长度
min:integer, // 最小整数
max:integer, // 最大整数
minDecimal:number, // 最小小数
maxDecimal:number, // 最大小数
startDateTime:string, // 开始时间
limitDateTime:string, // 结束时间
startDate:string, // 开始时间
limitDate:string, // 结束时间
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f42af0df0ee80d40eb21a9",
"name": "像素",
"note": "像素",
"key": "pixel",
"createDate": "2023-02-21T02:22:40.664Z",
"updateDate": "2023-02-21T02:22:40.664Z"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
列出资源属性 /v2/resources/attrs/list GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
skip | number | 跳过的数目 | 是 |
limit | number | 查询的数目 | 是 |
nameOrKey | string | 名称或者键 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"num": 7,
"resourceAttrs": {
"skip": 0,
"limit": 10,
"totalItem": 7,
"dataList": [
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dc03",
"name": "MIME类型",
"key": "mime",
"createDate": "2023-02-20T08:35:03.977Z",
"updateDate": "2023-02-20T08:35:03.977Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f42af0df0ee80d40eb21a9",
"name": "像素",
"note": "像素",
"key": "pixel",
"createDate": "2023-02-21T02:22:40.664Z",
"updateDate": "2023-02-21T02:22:40.664Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dbfc",
"name": "大小",
"key": "file_size",
"createDate": "2023-02-20T08:35:03.925Z",
"updateDate": "2023-02-20T08:35:03.925Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dc01",
"name": "字数",
"key": "words_count",
"createDate": "2023-02-20T08:35:03.971Z",
"updateDate": "2023-02-20T08:35:03.971Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dc05",
"name": "尺寸",
"key": "dimensions",
"createDate": "2023-02-20T08:35:03.984Z",
"updateDate": "2023-02-20T08:35:03.984Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dbff",
"name": "时长",
"key": "duration",
"createDate": "2023-02-20T08:35:03.963Z",
"updateDate": "2023-02-20T08:35:03.963Z"
},
{
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dc07",
"name": "节拍",
"key": "tempo",
"createDate": "2023-02-20T08:35:03.990Z",
"updateDate": "2023-02-20T08:35:03.990Z"
}
]
}
}
}
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
76
77
78
79
80
81
82
83
84
85
86
87
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
87
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
name | string | 名称 |
note | string | 备注 |
key | string | 键 |
format | number | 值格式 1:文本 2:数值 3:时间 4:日期 5:日期和时间 |
formatUnit | string | 格式单位 |
autoConvert | boolean | 是否自动转换 |
insertMode | number | 录入方式 1:系统解析 |
dependencies | number | 依赖数 |
编辑资源属性 /resources/attrs/update POST JSON
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
name | string | 名称 | 是 |
note | string | 备注 | 是 |
format | number | 值格式 1:文本 2:数值 3:时间 4:日期 5:日期和时间 | 是 |
formatUnit | string | 格式单位 | 否 |
autoConvert | boolean | 是否自动转换 | 否 |
key | string | 键 | 是 |
contentRule | {} | 值验证格式 | 否 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": null
}
1
2
3
4
5
6
7
2
3
4
5
6
7
通过key取资源属性 /v2/resources/attrs/getInfoByKey GET QUERY
参数名 | 参数类型 | 参数描述 | 必选 |
---|---|---|---|
key | string | 键 | 是 |
返回结构:
{
"ret": 0,
"errCode": 0,
"errcode": 0,
"msg": "success",
"data": {
"format": 1,
"insertMode": 1,
"dependencies": 0,
"_id": "63f330b7a743752d6897dbfc",
"name": "大小",
"key": "file_size",
"createDate": "2023-02-20T08:35:03.925Z",
"updateDate": "2023-02-20T08:35:03.925Z"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
结构参数:
参数名 | 参数类型 | 参数描述 |
---|---|---|
name | string | 名称 |
note | string | 备注 |
key | string | 键 |
format | number | 值格式 1:文本 2:数值 3:时间 4:日期 5:日期和时间 |
formatUnit | string | 格式单位 |
autoConvert | boolean | 是否自动转换 |
insertMode | number | 录入方式 1:系统解析 |
dependencies | number | 依赖数 |