Commit e7e1ae9e by sikang

添加埋点

parent 55fb0303
......@@ -112,6 +112,16 @@ public interface UserApi {
Observable<UserBean> getUserInfo(@Header("X-AUTH-TOKEN") String token);
/**
* 埋点
*/
@GET("loanapp/point_report")
Observable<ResponseBody> trackEvent(@Query("reportType") String reportType,
@Query("actionType") String actionType,
@Query("comment") String comment
);
/**
* 学历列表
*/
@GET("sysdict/{type}")
......
......@@ -11,6 +11,7 @@ import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
......@@ -39,6 +40,7 @@ import com.common.bean.LoanInfo;
import com.common.bean.LoaningAmoutBean;
import com.common.bean.PersonalInfoServerBean;
import com.common.bean.RecordFilesResponse;
import com.common.bean.RegionBean;
import com.common.bean.TokenInfoBean;
import com.common.bean.UserBankInfo;
import com.common.bean.UserBean;
......@@ -47,6 +49,7 @@ import com.facebook.libfbref.FbDeepLink;
import tech.starwin.network.Gateway;
import tech.starwin.network.ServiceGenerator;
import tech.starwin.utils.AccountKitUtils;
import tech.starwin.utils.LogUtils;
import tech.starwin.utils.LoginManager;
import tech.starwin.network.tools.MultipartBodyMaker;
import tech.starwin.utils.PreferencesManager;
......@@ -184,6 +187,37 @@ public class UserPresenter extends BasePresenter<UserApi> {
/**
* 活动中心数据
*/
public void trackEvent(String event) {
apiService.trackEvent("system", "api", event)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new HttpObserver<ResponseBody>() {
@Override
public void onStart() {
}
@Override
public void onSuccess(ResponseBody data) {
LogUtils.d(TAG, "");
}
@Override
public void onError(int code, String msg) {
LogUtils.d(TAG, "");
}
@Override
public void onFinish() {
}
});
}
/**
* 上传firebaseToken
*/
public void uploadFirebaseToken(String token) {
......@@ -567,7 +601,7 @@ public class UserPresenter extends BasePresenter<UserApi> {
}
}
//不开启同盾
if(!data.isTongDunFlag()){
if (!data.isTongDunFlag()) {
LibConfig.TONGDUN_PARENT_KEY = "";
}
data.setUpdateTime(System.currentTimeMillis());
......
......@@ -9,6 +9,7 @@ import android.widget.TextView;
import tech.starwin.LibConfig;
import tech.starwin.mvp.presenter.UserPresenter;
/**
......@@ -18,6 +19,7 @@ import tech.starwin.LibConfig;
public class TrackEventHelper {
public static final String REST_URL = "rest_url";
private static OnTrackEventListener onTrackEventListener = null;
private static UserPresenter userPresenter = new UserPresenter();
/**
* click埋点,CONTENT_TYPE = view.getTag()
......@@ -65,6 +67,7 @@ public class TrackEventHelper {
//TODO - FireBase配置
//FireBase 埋点
// FirebaseAnalytics.getInstance(LibConfig.getActivity()).logEvent(eventName, null);
userPresenter.trackEvent(eventName);
if (onTrackEventListener != null) {
onTrackEventListener.onActionEvent(eventName);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment