Initial Ktor backend skeleton with ProtocolMessage DTO, REST and WebSocket
This commit is contained in:
36
.gitignore
vendored
36
.gitignore
vendored
@@ -1,23 +1,25 @@
|
|||||||
# Kotlin/Java
|
# Gradle/Java/Kotlin
|
||||||
*.class
|
.gradle/
|
||||||
*.jar
|
|
||||||
*.iml
|
|
||||||
/out/
|
|
||||||
build/
|
build/
|
||||||
|
out/
|
||||||
|
*.iml
|
||||||
|
|
||||||
# ESP32 / PlatformIO / Arduino
|
# IDEA
|
||||||
*.bin
|
|
||||||
*.elf
|
|
||||||
*.pio
|
|
||||||
*.pioenvs/
|
|
||||||
*.idf/
|
|
||||||
|
|
||||||
# Android
|
|
||||||
/.gradle/
|
|
||||||
/build/
|
|
||||||
/local.properties
|
|
||||||
.idea/
|
.idea/
|
||||||
|
*.iws
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
|
||||||
# OS
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Node/npm (если есть frontend/mobile)
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# Python (если будет)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
#Mon Mar 30 18:39:06 EEST 2026
|
|
||||||
gradle.version=9.3.0
|
|
||||||
Binary file not shown.
BIN
backend/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
backend/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
13
protocol/examples/command.json
Normal file
13
protocol/examples/command.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"v": 1,
|
||||||
|
"id": "cmd-123",
|
||||||
|
"type": "command",
|
||||||
|
"ts": 1710000000,
|
||||||
|
"deviceId": "esp32-001",
|
||||||
|
"payload": {
|
||||||
|
"command": "setRelay",
|
||||||
|
"params": {
|
||||||
|
"state": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
protocol/examples/event.json
Normal file
12
protocol/examples/event.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"v": 1,
|
||||||
|
"id": "evt-123",
|
||||||
|
"type": "event",
|
||||||
|
"ts": 1710000003,
|
||||||
|
"deviceId": "esp32-001",
|
||||||
|
"payload": {
|
||||||
|
"event": "overheat",
|
||||||
|
"level": "warning",
|
||||||
|
"message": "Temperature too high"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
protocol/examples/response.json
Normal file
12
protocol/examples/response.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"v": 1,
|
||||||
|
"id": "resp-123",
|
||||||
|
"type": "response",
|
||||||
|
"ts": 1710000001,
|
||||||
|
"deviceId": "esp32-001",
|
||||||
|
"payload": {
|
||||||
|
"requestId": "cmd-123",
|
||||||
|
"status": "ok",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
protocol/examples/telemetry.json
Normal file
12
protocol/examples/telemetry.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"v": 1,
|
||||||
|
"id": "tel-123",
|
||||||
|
"type": "telemetry",
|
||||||
|
"ts": 1710000002,
|
||||||
|
"deviceId": "esp32-001",
|
||||||
|
"payload": {
|
||||||
|
"voltage": 220.5,
|
||||||
|
"current": 1.2,
|
||||||
|
"temperature": 36.6
|
||||||
|
}
|
||||||
|
}
|
||||||
12
protocol/schema.json
Normal file
12
protocol/schema.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": ["v", "id", "type", "ts", "deviceId", "payload"],
|
||||||
|
"properties": {
|
||||||
|
"v": { "type": "integer" },
|
||||||
|
"id": { "type": "string" },
|
||||||
|
"type": { "type": "string" },
|
||||||
|
"ts": { "type": "integer" },
|
||||||
|
"deviceId": { "type": "string" },
|
||||||
|
"payload": { "type": "object" }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user