外观
站点列表
接口说明
获取当前账号(customerId)名下全部站点。返回结果为树形结构:顶层站点对象的 children 数组里挂着子站点,可递归展开。
站点是平台里组织设备的层级容器(例如「测试基地」下有「温室#1」「温室#2」)。 查询设备、历史数据、视频地址时都会用到站点 ID。
请求地址
text
GET https://yunshangwenshi.auto-control.com.cn/api/station1
请求方法
GET
请求参数
无请求参数
接口文档未定义本接口的任何请求参数,账号可见范围由登录账号的 customerId 决定。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| — | — | — | 暂未定义 | — |
请求头
| 请求头 | 值 | 必填 |
|---|---|---|
Authorization | Bearer <token> | 是 |
返回字段
顶层为风格 A 的完整包装,data 为站点对象数组。
站点对象字段
| 字段名 | 类型 | 说明 | 示例 |
|---|---|---|---|
id | Int | 站点 ID,后续接口的 stationId 用它 | 5819 |
name | String | 站点名称 | 测试基地 |
parentId | Int | 父站点 ID;顶层站点为 0 | 0 |
children | Array | 子站点数组,结构与父站点相同;无子站点时为空数组 | [ {...} ] |
customerId | Long | 所属客户 ID | 1667372262 |
createDate | String | 创建时间(yyyy-MM-dd HH:mm:ss) | 2022-11-02 14:57:42 |
modifiedDate | String | 最后修改时间 | 2025-03-20 16:05:23 |
images | Array<String> | 站点图片 URL 列表(带签名,有时效) | ["http://iot-pictures.oss-..."] |
logo | String | 站点 Logo URL(带签名,有时效) | "http://iot-pictures.oss-..." |
description | String | 站点描述,可能为空串 | "" |
gisLat | Number | 纬度(GCJ-02 或 WGS-84,暂未定义) | 39.905556 |
gisLng | Number | 经度(坐标系暂未定义) | 116.424722 |
deviceCount | Int | 该站点下的设备数量 | 0 |
displayName | String | 展示名,可能为空串 | "" |
sortOrder | Int | 排序权重 | 0 |
stationType | String | 站点类型标识 | "1" |
area | String | 面积(单位暂未定义) | "" |
kind | String | 站点种类,暂未定义取值 | "" |
growthCycle | String | 生长周期,暂未定义取值 | "" |
statistic | String | 统计配置,暂未定义取值 | "" |
suffixTitle | String | 标题后缀 | "" |
x | String | 平面图 X 坐标 | "" |
y | String | 平面图 Y 坐标 | "" |
plantQuantity | String | 种植数量 | "" |
cycleInterval | Int | 循环间隔 | 3 |
regionPic | String | 区域底图 URL | "" |
projectTitle | String | 项目标题(用于大屏/看板) | 智慧农业信息化物联网平台 |
projectDescription | String | 项目描述 | 云上温室 |
showLogo | Int | 是否显示 Logo:1 显示 / 0 不显示 | 1 |
fontColor | String | 标题字体颜色(十六进制) | #FFFFFF |
bold | Int | 标题是否加粗:1 是 / 0 否 | 0 |
italic | Int | 标题是否斜体:1 是 / 0 否 | 0 |
shadow | Int | 是否显示阴影:1 是 / 0 否 | 0 |
shadowColor | String | 阴影颜色 | #909399 |
devices | String | JSON 字符串(非对象数组),描述站点关联的设备 | [{"id":79911,...}] |
setValue | String | 站点关联的设定值地址列表,逗号分隔 | 163447,163422,163419 |
stationAssociation | String | 站点关联配置,暂未定义取值 | "" |
leadTitle | String | 主标题文案 | "" |
showLead | Int | 是否显示主标题:1 是 / 0 否 | 1 |
leadTitle1 | String | 副标题文案 | "" |
ledShow | Int | 是否启用 LED 显示:1 是 / 0 否 | 1 |
customNameOne~customNameFour | String | 自定义字段名 1~4 | "" |
customContentOne~customContentFour | String | 自定义字段内容 1~4 | "" |
devices 是 JSON 字符串,需要二次解析
示例中 devices 的值为 "[{\"id\":79911,\"deviceTypeId\":79911,\"name\":\"2#外遮阳幕 \",\"alias\":\"2#外遮阳幕测试\",\"sortOrder\":6}]" —— 它是一个被转义的 JSON 字符串,不是 JSON 数组。反序列化时请先按字符串取出,再做一次 JSON 解析。
images / logo 是带签名的临时链接
这些 OSS 链接带 Expires 与 Signature 参数,会过期。请勿把链接长期缓存或落库, 应在每次展示时从本接口重新获取。
请求示例
curl
bash
curl 'https://yunshangwenshi.auto-control.com.cn/api/station' \
-H "Authorization: Bearer <token>"1
2
2
HTTP 报文
http
GET /api/station HTTP/1.1
Host: yunshangwenshi.auto-control.com.cn
Authorization: Bearer <token>
Accept: application/json1
2
3
4
2
3
4
Python
python
import requests
BIZ_HOST = "https://yunshangwenshi.auto-control.com.cn"
def list_stations(token: str):
"""获取站点树。返回顶层站点列表。"""
resp = requests.get(
f"{BIZ_HOST}/api/station",
headers={"Authorization": f"Bearer {token}"},
timeout=15,
)
body = resp.json()
if body.get("code") != 200:
raise RuntimeError(f"查询失败: {body.get('code')} {body.get('message')}")
stations = body["data"] or []
def walk(nodes, depth=0):
for n in nodes:
print(f"{' ' * depth}- {n['id']} {n['name']} (deviceCount={n['deviceCount']})")
walk(n.get("children") or [], depth + 1)
walk(stations)
return stations
if __name__ == "__main__":
list_stations("<你的 token>")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
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
Java
java
import java.net.URI;
import java.net.http.*;
import java.time.Duration;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class StationApi {
private static final String BIZ_HOST = "https://yunshangwenshi.auto-control.com.cn";
private static final ObjectMapper MAPPER = new ObjectMapper();
public static JsonNode listStations(String token) throws Exception {
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create(BIZ_HOST + "/api/station"))
.header("Authorization", "Bearer " + token)
.timeout(Duration.ofSeconds(15))
.GET()
.build();
HttpResponse<String> resp = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
JsonNode body = MAPPER.readTree(resp.body());
if (body.path("code").asInt() != 200) {
throw new IllegalStateException("查询站点失败: " + resp.body());
}
return body.path("data"); // 站点对象数组
}
}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
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
返回示例
json
{
"requestId": "552e480a-88fa-40da-913c-78436d20aa9f",
"code": 200,
"data": [
{
"id": 5819,
"createDate": "2022-11-02 14:57:42",
"modifiedDate": "2025-03-20 16:05:23",
"customerId": 1667372262,
"name": "测试基地",
"parentId": 0,
"images": [],
"description": "",
"gisLat": 39.905556,
"gisLng": 116.424722,
"deviceCount": 0,
"displayName": "",
"sortOrder": 0,
"children": [
{
"id": 9435,
"createDate": "2024-12-02 11:10:24",
"modifiedDate": "2024-12-02 11:10:24",
"customerId": 1667372262,
"name": "1-测试",
"parentId": 5819,
"images": [],
"description": "",
"deviceCount": 0,
"displayName": "",
"sortOrder": 1,
"children": [],
"area": "",
"kind": "",
"growthCycle": "",
"cycleInterval": 3,
"regionPic": "",
"projectTitle": "",
"projectDescription": "",
"showLogo": 1,
"logo": "http://iot-pictures.oss-cn-beijing.aliyuncs.com/?Expires=1751046479&OSSAccessKeyId=LTAI5t...&Signature=ZPrg4ff%2FR8hjJWbErCCHjC5Cv0w%3D",
"fontColor": "",
"bold": 0,
"italic": 0,
"shadow": 0,
"shadowColor": "",
"devices": "",
"setValue": "",
"stationType": "1",
"leadTitle": "",
"showLead": 1,
"leadTitle1": "",
"stationAssociation": "",
"ledShow": 1
},
{
"id": 6024,
"createDate": "2022-11-30 14:02:43",
"modifiedDate": "2025-06-12 16:57:23",
"customerId": 1667372262,
"name": "徐专用温室",
"parentId": 5819,
"images": [],
"description": "",
"deviceCount": 1,
"displayName": "",
"sortOrder": 3,
"children": [],
"cycleInterval": 3,
"projectTitle": "",
"showLogo": 1,
"devices": "[{\"id\":79911,\"deviceTypeId\":79911,\"name\":\"2#外遮阳幕 \",\"alias\":\"2#外遮阳幕测试\",\"sortOrder\":6}]",
"setValue": "163447,163422,163419",
"stationType": "1",
"showLead": 0,
"ledShow": 0
}
],
"area": "",
"kind": "",
"growthCycle": "",
"cycleInterval": 3,
"regionPic": "",
"projectTitle": "智慧农业信息化物联网平台",
"projectDescription": "云上温室",
"showLogo": 1,
"logo": "http://iot-pictures.oss-cn-beijing.aliyuncs.com/logo/88c64ff73002818bbd0098eb7075b8f4.png?Expires=1751096526&OSSAccessKeyId=LTAI5t...&Signature=cdcWOP%2FFrzTCCjUFyD8tLC5Wstw%3D",
"fontColor": "#FFFFFF",
"bold": 0,
"italic": 0,
"shadow": 0,
"shadowColor": "#909399",
"devices": "",
"setValue": "",
"stationType": "",
"leadTitle": "",
"showLead": 1,
"ledTitle1": "",
"stationAssociation": "",
"ledShow": 1
}
],
"timestamp": 1750207571882,
"success": true
}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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
示例数据来自 接口文档
上述返回体的结构与字段取值来源为示例,仅用于说明格式。真实数据请调用接口获取。 OSS 链接已在文档中截断(LTAI5t...),避免公开完整的访问密钥 ID 与签名。
注意事项
站点树要递归展开
顶层返回的数组只包含 parentId = 0 的站点。所有子站点都在 children 里, 需要递归遍历才能拿到完整清单。请勿只取第一层。
建议在本地缓存站点结构
站点结构变更频率很低。建议在系统里建一张「站点 ID → 站点名称」的本地映射表, 按小时或按天刷新,而不是每次业务请求都调一次本接口。
图片与 Logo 的链接会过期
images 与 logo 字段是带签名、带有效期的 OSS 链接。
- 不要落库长期保存
- 不要在前端做长期缓存
- 展示时实时从本接口取
站点可见性由账号决定
本接口没有 customerId 之类的参数 —— 返回范围完全由 token 对应的账号决定。 拿到的站点就是你能看的全部站点。多出来的站点意味着账号权限过宽,请与运营方核对。
下一步
→ 设备列表:拿到站点 ID 后查该站点下的设备。