From 8f537de3bbf4dc1a742222dfd3123090b79e6419 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 19 Oct 2022 09:24:25 -0700 Subject: Fix command queue issue --- src/main/java/org/traccar/model/BaseCommand.java | 10 ---------- src/main/java/org/traccar/model/Command.java | 10 ++++++++++ src/main/java/org/traccar/model/QueuedCommand.java | 5 +++-- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/model/BaseCommand.java b/src/main/java/org/traccar/model/BaseCommand.java index 16df9c126..f87b8ef65 100644 --- a/src/main/java/org/traccar/model/BaseCommand.java +++ b/src/main/java/org/traccar/model/BaseCommand.java @@ -17,16 +17,6 @@ package org.traccar.model; public class BaseCommand extends Message { - private String description; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - private boolean textChannel; public boolean getTextChannel() { diff --git a/src/main/java/org/traccar/model/Command.java b/src/main/java/org/traccar/model/Command.java index 4ea619e95..99988dd82 100644 --- a/src/main/java/org/traccar/model/Command.java +++ b/src/main/java/org/traccar/model/Command.java @@ -96,4 +96,14 @@ public class Command extends BaseCommand { super.setDeviceId(deviceId); } + private String description; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + } diff --git a/src/main/java/org/traccar/model/QueuedCommand.java b/src/main/java/org/traccar/model/QueuedCommand.java index fff77a22b..96a1eca4b 100644 --- a/src/main/java/org/traccar/model/QueuedCommand.java +++ b/src/main/java/org/traccar/model/QueuedCommand.java @@ -15,18 +15,19 @@ */ package org.traccar.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.traccar.storage.StorageName; import java.util.HashMap; @StorageName("tc_commands_queue") +@JsonIgnoreProperties(ignoreUnknown = true) public class QueuedCommand extends BaseCommand { public static QueuedCommand fromCommand(Command command) { QueuedCommand queuedCommand = new QueuedCommand(); queuedCommand.setDeviceId(command.getDeviceId()); queuedCommand.setType(command.getType()); - queuedCommand.setDescription(command.getDescription()); queuedCommand.setTextChannel(command.getTextChannel()); queuedCommand.setAttributes(new HashMap<>(command.getAttributes())); return queuedCommand; @@ -36,7 +37,7 @@ public class QueuedCommand extends BaseCommand { Command command = new Command(); command.setDeviceId(getDeviceId()); command.setType(getType()); - command.setDescription(getDescription()); + command.setDescription(""); command.setTextChannel(getTextChannel()); command.setAttributes(new HashMap<>(getAttributes())); return command; -- cgit v1.2.3