Commit 8f075270 authored by mengcuiguang's avatar mengcuiguang

添加三方调用失败上传接口

parent eac2b2b1
...@@ -273,4 +273,7 @@ object Constant { ...@@ -273,4 +273,7 @@ object Constant {
const val GRO_MORE_ADTYPE0 = "0" const val GRO_MORE_ADTYPE0 = "0"
const val GRO_MORE_ADTYPE1 = "1" const val GRO_MORE_ADTYPE1 = "1"
const val GRO_MORE_ADTYPE2 = "2" const val GRO_MORE_ADTYPE2 = "2"
// 异常上报类型
const val SHUMEI_EXCEPTION = "SHUMEI"
} }
...@@ -6,6 +6,9 @@ import android.text.TextUtils; ...@@ -6,6 +6,9 @@ import android.text.TextUtils;
import com.ishumei.smantifraud.SmAntiFraud; import com.ishumei.smantifraud.SmAntiFraud;
import com.mints.goodmoney.MintsApplication; import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import java.util.HashMap;
/** /**
* 描述:数美反欺诈 * 描述:数美反欺诈
...@@ -69,6 +72,12 @@ public class ShumeiManager { ...@@ -69,6 +72,12 @@ public class ShumeiManager {
SmAntiFraud.create(context, option); SmAntiFraud.create(context, option);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
HashMap<String, Object> vo = new HashMap<>();
vo.put("type", Constant.SHUMEI_EXCEPTION);
vo.put("msg", e.getMessage());
vo.put("stack", e.toString());
vo.put("event", "init");
TrackManager.getInstance().cmtExceptionInfo(vo);
} }
} }
...@@ -82,6 +91,13 @@ public class ShumeiManager { ...@@ -82,6 +91,13 @@ public class ShumeiManager {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
id = ""; id = "";
HashMap<String, Object> vo = new HashMap<>();
vo.put("type", Constant.SHUMEI_EXCEPTION);
vo.put("msg", e.getMessage());
vo.put("stack", e.toString());
vo.put("event", "getDeviceId");
TrackManager.getInstance().cmtExceptionInfo(vo);
} }
if (TextUtils.isEmpty(id)) { if (TextUtils.isEmpty(id)) {
......
...@@ -149,4 +149,10 @@ public class TrackManager { ...@@ -149,4 +149,10 @@ public class TrackManager {
trackPresenter.cmtGroMoreInfo(vo); trackPresenter.cmtGroMoreInfo(vo);
} }
} }
public void cmtExceptionInfo(HashMap<String, Object> vo) {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.cmtExceptionInfo(vo);
}
}
} }
...@@ -419,4 +419,23 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -419,4 +419,23 @@ public class TrackPresenter extends BaseTrackPresenter {
} }
}); });
} }
public void cmtExceptionInfo(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportError(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
} }
...@@ -663,6 +663,14 @@ public interface LoanService { ...@@ -663,6 +663,14 @@ public interface LoanService {
@POST("api/reportAdIncome") @POST("api/reportAdIncome")
Observable<BaseResponse<Object>> reportAdIncome(@Body Map<String, Object> vo); Observable<BaseResponse<Object>> reportAdIncome(@Body Map<String, Object> vo);
/**
* 三方调用失败上传
*
* @return
*/
@POST("api/reportError")
Observable<BaseResponse<Object>> reportError(@Body Map<String, Object> vo);
/** /**
......
...@@ -6,6 +6,7 @@ import android.content.Intent; ...@@ -6,6 +6,7 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.manager.TrackManager; import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.mvp.presenters.VersionUpdatePresenter; import com.mints.goodmoney.mvp.presenters.VersionUpdatePresenter;
import com.mints.goodmoney.ui.activitys.SplashADActivity; import com.mints.goodmoney.ui.activitys.SplashADActivity;
...@@ -33,7 +34,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -33,7 +34,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
private VersionUpdatePresenter vup; private VersionUpdatePresenter vup;
private WeakReference<Activity> reference; private WeakReference<Activity> reference;
private Intent ylhIntent; private Intent ylhIntent;
private Intent ksIntent; private Intent groIntent;
private Intent csjIntent; private Intent csjIntent;
public static ForegroundOrBackground init(Application application) { public static ForegroundOrBackground init(Application application) {
...@@ -107,33 +108,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -107,33 +108,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// 60秒后打开应用 显示开屏广告 // 60秒后打开应用 显示开屏广告
if (System.currentTimeMillis() - leaveTime >= 60000) { if (System.currentTimeMillis() - leaveTime >= 60000) {
// if (isYlhSplash) { if (AppConfig.groMoreVideoAdCount > 0) {
// isYlhSplash = false; if (groIntent == null) {
// groIntent = new Intent(activity, SplashGroMoreActivity.class);
// if (ylhIntent == null) { }
// // 优量汇广告 activity.startActivity(groIntent);
// ylhIntent = new Intent(activity, SplashADActivity.class); } else {
// } if (isYlhSplash) {
// activity.startActivity(ylhIntent); isYlhSplash = false;
// } else {
// isYlhSplash = true; if (ylhIntent == null) {
// // 优量汇广告
// if (csjIntent == null) { ylhIntent = new Intent(activity, SplashADActivity.class);
// // 快手广告 }
// csjIntent = new Intent(activity, SplashCsjADActivity.class); activity.startActivity(ylhIntent);
// } } else {
// activity.startActivity(csjIntent); isYlhSplash = true;
//
//// if (ksIntent == null) { if (csjIntent == null) {
//// // 快手广告 // 快手广告
//// ksIntent = new Intent(activity, SplashKsADActivity.class); csjIntent = new Intent(activity, SplashCsjADActivity.class);
//// } }
//// activity.startActivity(ksIntent); activity.startActivity(csjIntent);
// } }
if (ksIntent == null) {
ksIntent = new Intent(activity, SplashGroMoreActivity.class);
} }
activity.startActivity(ksIntent);
} }
} }
count++; count++;
......
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