|
|
@@ -4,6 +4,9 @@ package com.sheep.gamegroup.util;
|
|
|
import android.content.Context;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.statistics.AppStatistics;
|
|
|
import com.sheep.gamegroup.statistics.AppStatisticsConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
@@ -11,6 +14,9 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import rx.android.schedulers.AndroidSchedulers;
|
|
|
+import rx.schedulers.Schedulers;
|
|
|
+
|
|
|
/**
|
|
|
* Created by zhanghai on 2018/3/30.
|
|
|
*/
|
|
|
@@ -96,6 +102,34 @@ public class UMConfigUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public enum IdEvent{
|
|
|
+ HOME_LIST,//id 1 首页功能列表
|
|
|
+ BANNER(),//id 2 首页轮播图
|
|
|
+ TASK(),//id 3 任务列表
|
|
|
+ ;
|
|
|
+ private int getType(){
|
|
|
+ return ordinal()+1;
|
|
|
+ }
|
|
|
+ synchronized public void commit(int click_id){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("click_id", click_id);
|
|
|
+ jsonObject.put("type", getType());
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().commitIdEvent(jsonObject)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
public static class Source{
|
|
|
public static final String QQ = "QQ";
|
|
|
public static final String WECHAT = "wechat";
|