Merge remote-tracking branch 'origin/dialogs' into adrian/dialogs
This commit is contained in:
commit
d5e8345051
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue