smart-house-web: бэкенд
This commit is contained in:
71
smart-house-web/backend/test.http
Normal file
71
smart-house-web/backend/test.http
Normal file
@@ -0,0 +1,71 @@
|
||||
### DEBUG
|
||||
GET http://localhost:8080/debug
|
||||
|
||||
### list rooms
|
||||
GET http://localhost:8080/rooms
|
||||
|
||||
### post all rooms
|
||||
POST http://localhost:8080/rooms
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"ROOM0": {
|
||||
"devices": {}
|
||||
},
|
||||
"ROOM1": {
|
||||
"devices": {
|
||||
"therm": {
|
||||
"type": "Thermometer",
|
||||
"temperature": 22
|
||||
},
|
||||
"psock": {
|
||||
"type": "PowerSocket",
|
||||
"power_rate": 11,
|
||||
"on": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
### drop room
|
||||
DELETE http://localhost:8080/room/ROOM
|
||||
|
||||
### add room
|
||||
PUT http://localhost:8080/room/ROOM
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"devices": {
|
||||
"therm": {
|
||||
"type": "Thermometer",
|
||||
"temperature": 20
|
||||
},
|
||||
"psock": {
|
||||
"type": "PowerSocket",
|
||||
"power_rate": 10,
|
||||
"on": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
### get room
|
||||
GET http://localhost:8080/room/ROOM1
|
||||
|
||||
### get room devices
|
||||
GET http://localhost:8080/room/ROOM1/devices
|
||||
|
||||
### get room device
|
||||
GET http://localhost:8080/room/ROOM/device/TEST
|
||||
|
||||
### get room device
|
||||
PUT http://localhost:8080/room/ROOM/device/TEST
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"type": "PowerSocket",
|
||||
"power_rate": 5,
|
||||
"on": true
|
||||
}
|
||||
|
||||
### get room device
|
||||
DELETE http://localhost:8080/room/ROOM/device/TEST
|
||||
Reference in New Issue
Block a user