aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2021-12-21 14:21:16 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2021-12-21 14:21:16 -0600
commit7c8a65b8d1ae8a049bf67260acb6fafbd95adac9 (patch)
tree8e536d19e63df3fe53f921858a710746b5df0e2a /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers
parent090bcc911e569040ceeaef29f7ca8db82694d9b0 (diff)
downloadetbsa-trackermap-mobile-7c8a65b8d1ae8a049bf67260acb6fafbd95adac9.tar.gz
etbsa-trackermap-mobile-7c8a65b8d1ae8a049bf67260acb6fafbd95adac9.tar.bz2
etbsa-trackermap-mobile-7c8a65b8d1ae8a049bf67260acb6fafbd95adac9.zip
Implements the commands list
- Shows command details - Sends a selected command to a device
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt29
1 files changed, 0 insertions, 29 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
deleted file mode 100644
index b710763..0000000
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package mx.trackermap.TrackerMap.controllers
-
-import mx.trackermap.TrackerMap.client.apis.CommandsApi
-import mx.trackermap.TrackerMap.client.models.Command
-import mx.trackermap.TrackerMap.client.models.Device
-
-class CommandsController(
- val commandsApi: CommandsApi,
- val sessionController: SessionController)
-{
- var commands = emptyArray<Command>()
- val deviceCommands = mutableMapOf<Int, Array<Command>>()
-
- suspend fun getAllCommands () {
- sessionController.user?.id?.let {
- commands = commandsApi.commandsGet(userId = it)
- }
- }
-
- suspend fun getDeviceCommands (device: Device) {
- device.id?.let {
- deviceCommands[it] = commandsApi.commandsSendGet (deviceId = device.id)
- }
- }
-
- suspend fun sendCommand (command: Command) {
- commandsApi.commandsSendPost(command)
- }
-} \ No newline at end of file