aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-19 09:24:25 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-19 09:24:25 -0700
commit8f537de3bbf4dc1a742222dfd3123090b79e6419 (patch)
treebb65c03a06bd9a464e6bbfd77ad1239df0cc9ca5 /src/main
parentca504df5720f1b26830f9f5f4099d1e9903ea2f1 (diff)
downloadtrackermap-server-8f537de3bbf4dc1a742222dfd3123090b79e6419.tar.gz
trackermap-server-8f537de3bbf4dc1a742222dfd3123090b79e6419.tar.bz2
trackermap-server-8f537de3bbf4dc1a742222dfd3123090b79e6419.zip
Fix command queue issue
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/model/BaseCommand.java10
-rw-r--r--src/main/java/org/traccar/model/Command.java10
-rw-r--r--src/main/java/org/traccar/model/QueuedCommand.java5
3 files changed, 13 insertions, 12 deletions
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;