数据收集createdOn时间获取修改、添加game_id字段(在有game字段的地方)

This commit is contained in:
huangzhuanghua
2016-09-14 11:43:39 +08:00
parent 405056cbd3
commit 1acf79baae
35 changed files with 228 additions and 246 deletions

View File

@ -63,6 +63,7 @@ public class DataCollectionManager {
}
public static void onEvent(Context context, String type, Map<String, Object> map) {
map.put("createdOn", Utils.getTime(context));
if ("news".equals(type) || "download".equals(type) || "search".equals(type)) {
DataCollectionManager.getInstance(context).realTimeUpload(type, map);
return;
@ -71,10 +72,12 @@ public class DataCollectionManager {
}
public static void onEvent(Context context, String type, Map<String, Object> map, boolean isUpload) {
map.put("createdOn", Utils.getTime(context));
onEvent(context, type, new JSONObject(map).toString(), isUpload);
}
public static void upsert(Context context, String type, Map<String, Object> map) {
map.put("createdOn", Utils.getTime(context));
String id = UUID.randomUUID().toString().replaceAll("-", "");
DataCollectionInfo entity = new DataCollectionInfo();
entity.setId(id);
@ -141,8 +144,7 @@ public class DataCollectionManager {
public void onResponse(JSONObject response) {
Utils.log("realTimeUpload = " + response);
}
},
new Response.ErrorListener() {
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// 上传失败,检查网络状态,继续上传
@ -176,7 +178,6 @@ public class DataCollectionManager {
}
Map<String, Object> map = new HashMap<>();
map.put("data", data);
map.put("createdOn", System.currentTimeMillis() / 1000);
onEvent(mContext, "click", map);
dao.delete(ids);
}