150 lines
2.6 KiB
ReStructuredText
150 lines
2.6 KiB
ReStructuredText
# 变量定义
|
|
# @baseUrl = http://200.200.200.51:8080/config
|
|
# @baseUrl = http://192.168.6.51:8080/config
|
|
@baseUrl = http://localhost:8080/config
|
|
@token = Basic YWRtaW46MTIzNDU2
|
|
@contentType = application/json; charset=UTF-8
|
|
|
|
|
|
### 获取LAN信息 ---------------------------------------------
|
|
GET {{baseUrl}}/lan HTTP/1.1
|
|
Authorization: {{token}}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "dhcp": false,
|
|
# "ip": "192.168.6.51",
|
|
# "mask": "255.255.255.0",
|
|
# "gateway": "192.168.6.1",
|
|
# "dns": "8.8.8.8"
|
|
# }
|
|
|
|
### 设置LAN ---------------------------------------------
|
|
PUT {{baseUrl}}/lan HTTP/1.1
|
|
Authorization: {{token}}
|
|
Content-Type: {{contentType}}
|
|
|
|
{
|
|
"dhcp": false,
|
|
"ip": "192.168.6.51",
|
|
"mask": "255.255.252.0",
|
|
"gateway": "192.168.6.1",
|
|
"dns": "8.8.8.8"
|
|
}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "dhcp": false,
|
|
# "ip": "192.168.6.51",
|
|
# "mask": "255.255.252.0",
|
|
# "gateway": "192.168.6.1",
|
|
# "dns": "8.8.8.8"
|
|
# }
|
|
|
|
# 失败应答:
|
|
# {
|
|
# "err": "request error: wrong gateway"
|
|
# }
|
|
|
|
|
|
### 获取主继电器配置 ---------------------------------------------
|
|
GET {{baseUrl}}/main_relay HTTP/1.1
|
|
Authorization: {{token}}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "lockDelayMs": 5000,
|
|
# "unlockDelayMs": 2000
|
|
# }
|
|
|
|
### 设置主继电器配置 ---------------------------------------------
|
|
PUT {{baseUrl}}/main_relay HTTP/1.1
|
|
Authorization: {{token}}
|
|
Content-Type: {{contentType}}
|
|
|
|
{
|
|
"lockDelayMs": 5000,
|
|
"unlockDelayMs": 2000
|
|
}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "lockDelayMs": 5000,
|
|
# "unlockDelayMs": 1000
|
|
# }
|
|
|
|
|
|
### 获取电梯配置 ---------------------------------------------
|
|
GET {{baseUrl}}/elevator HTTP/1.1
|
|
Authorization: {{token}}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "enabled": true,
|
|
# "timeoutMs": 8000,
|
|
# "portHintList": [],
|
|
# "portCount": 0
|
|
# }
|
|
|
|
|
|
### 设置电梯配置 ---------------------------------------------
|
|
PUT {{baseUrl}}/elevator HTTP/1.1
|
|
Authorization: {{token}}
|
|
Content-Type: {{contentType}}
|
|
|
|
{
|
|
"enabled": true,
|
|
"timeoutMs": 8000,
|
|
"portHintList": [],
|
|
"portCount": 0
|
|
}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "enabled": true,
|
|
# "timeoutMs": 8000,
|
|
# "portHintList": [],
|
|
# "portCount": 0
|
|
# }
|
|
|
|
|
|
### 获取设备配置 ---------------------------------------------
|
|
GET {{baseUrl}}/device HTTP/1.1
|
|
Authorization: {{token}}
|
|
|
|
# 成功应答:
|
|
{
|
|
"type": 0,
|
|
"sn": 1,
|
|
"name": "test",
|
|
"unit": 1,
|
|
"room": 101
|
|
}
|
|
|
|
|
|
### 设置设备配置 ---------------------------------------------
|
|
PUT {{baseUrl}}/device HTTP/1.1
|
|
Authorization: {{token}}
|
|
Content-Type: {{contentType}}
|
|
|
|
{
|
|
"type": 0,
|
|
"sn": 0,
|
|
"name": "test",
|
|
"unit": 12,
|
|
"room": 101,
|
|
"keypad":1
|
|
}
|
|
|
|
# 成功应答:
|
|
# {
|
|
# "type": 3,
|
|
# "sn": 1,
|
|
# "name": "test",
|
|
# "unit": 12,
|
|
# "room": 102,
|
|
# "keypad": 1
|
|
# }
|
|
|
|
|