Cleanup, a few more implementations of serializeToJSON for ClientToServer messages

pull/14/head
Sam Bosley 12 years ago
parent af034a4089
commit c64db963a1

@ -1,5 +1,6 @@
package com.todoroo.astrid.actfm.sync.messages;
import org.json.JSONException;
import org.json.JSONObject;
import com.todoroo.astrid.dao.RemoteModelDao;
@ -17,7 +18,16 @@ public class BriefMe<TYPE extends RemoteModel> extends ClientToServerMessage<TYP
@Override
public JSONObject serializeToJSON() {
return null;
JSONObject json = new JSONObject();
try {
json.put(TYPE_KEY, "BriefMe"); //$NON-NLS-1$
json.put(TABLE_KEY, NameMaps.getServerNameForTable(table));
json.put(UUID_KEY, uuid);
json.put(PUSHED_AT_KEY, pushedAt);
} catch (JSONException e) {
return null;
}
return json;
}
}

@ -56,9 +56,8 @@ public class NameMaps {
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.NOTES.name, "notes");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.RECURRENCE.name, "repeat");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.USER_ID.name, "user_id");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.USER.name, "user"); // TODO: NOT CORRECT
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.USER.name, "user");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.CREATOR_ID.name, "creator_id");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.SHARED_WITH.name, "shared_with"); //TODO: NOT CORRECT
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.UUID.name, "uuid");
TASK_COLUMNS_LOCAL_TO_SERVER.put(Task.PROOF_TEXT.name, "proof_text");

@ -1,5 +1,6 @@
package com.todoroo.astrid.actfm.sync.messages;
import org.json.JSONException;
import org.json.JSONObject;
import com.todoroo.astrid.dao.RemoteModelDao;
@ -13,6 +14,15 @@ public class RequestDoubleCheck<TYPE extends RemoteModel> extends ClientToServer
@Override
public JSONObject serializeToJSON() {
return null;
JSONObject json = new JSONObject();
try {
json.put(TYPE_KEY, "RequestDoubleCheck"); //$NON-NLS-1$
json.put(TABLE_KEY, NameMaps.getServerNameForTable(table));
json.put(UUID_KEY, uuid);
json.put(PUSHED_AT_KEY, pushedAt);
} catch (JSONException e) {
return null;
}
return json;
}
}

Loading…
Cancel
Save