Merge remote-tracking branch 'origin/dialogs' into adrian/dialogs

This commit is contained in:
AdrianLxM 2019-12-20 23:06:09 +01:00
commit d5e8345051
2 changed files with 10 additions and 10 deletions

View file

@ -42,29 +42,29 @@ public class DbRequest {
// dbAdd
public DbRequest(String action, String collection, JSONObject data) {
this.action = action;
this.collection = collection;
this.nsClientID = "" + DateUtil.now();
try {
data.put("NSCLIENT_ID", nsClientID);
} catch (JSONException e) {
e.printStackTrace();
}
this.action = action;
this.collection = collection;
this.data = data.toString();
this.nsClientID = "" + DateUtil.now();
this._id = "";
}
// dbUpdate, dbUpdateUnset
public DbRequest(String action, String collection, String _id, JSONObject data) {
this.action = action;
this.collection = collection;
this.nsClientID = "" + DateUtil.now();
try {
data.put("NSCLIENT_ID", nsClientID);
} catch (JSONException e) {
e.printStackTrace();
}
this.action = action;
this.collection = collection;
this.data = data.toString();
this.nsClientID = "" + DateUtil.now();
this._id = _id;
}
@ -72,15 +72,15 @@ public class DbRequest {
public DbRequest(String action, String collection,
String _id) {
JSONObject data = new JSONObject();
this.action = action;
this.collection = collection;
this.nsClientID = "" + DateUtil.now();
try {
data.put("NSCLIENT_ID", nsClientID);
} catch (JSONException e) {
e.printStackTrace();
}
this.action = action;
this.collection = collection;
this.data = data.toString();
this.nsClientID = "" + DateUtil.now();
this._id = _id;
}

View file

@ -217,7 +217,7 @@ public class NSUpload {
deviceStatus.uploaderBattery = batteryLevel;
deviceStatus.created_at = DateUtil.toISOString(new Date());
UploadQueue.add(new DbRequest("dbAdd", "devicestatus", deviceStatus.mongoRecord().toString()));
UploadQueue.add(new DbRequest("dbAdd", "devicestatus", deviceStatus.mongoRecord()));
} catch (JSONException e) {
log.error("Unhandled exception", e);
}