Commit fb4ea988 authored by mengcuiguang's avatar mengcuiguang

调整优先级

parent 8eb1f717
......@@ -122,26 +122,26 @@ public class VedioAdingManager {
/**
* 根据广告优先级获取下一个
* <p>
* 珊瑚>穿山甲激励> 优量汇>多盟>mintegral>东方网>全屏>创神
* 穿山甲激励> 优量汇> 珊瑚>创神>多盟>mintegral>东方网>全屏
*/
private String getNextAdType() {
String nextAdType = "";
if (AppConfig.shanhuAdCount > 0) {
nextAdType = Constant.SHANHU_VEDIO_AD;
} else if (AppConfig.csjVedioAdCount > 0) {
if (AppConfig.csjVedioAdCount > 0) {
nextAdType = Constant.CSJ_VEDIO_AD;
} else if (AppConfig.ylhAdCount > 0) {
nextAdType = Constant.YLH_VEDIO_AD;
} else if (AppConfig.shanhuAdCount > 0) {
nextAdType = Constant.SHANHU_VEDIO_AD;
} else if (AppConfig.chuangshenVedioAdCount > 0) {
nextAdType = Constant.CHUANGSHEN_VEDIO_AD;
} else if (AppConfig.duomentVedioAdCount > 0) {
nextAdType = Constant.DUOMENT_VEDIO_AD;
} else if (AppConfig.mintegralAdCount > 0) {
nextAdType = Constant.MINTEGRAL_VEDIO_AD;
} else if (AppConfig.csjFullAdCount > 0) {
nextAdType = Constant.CSJ_FULL_AD;
} else if (AppConfig.chuangshenVedioAdCount > 0) {
nextAdType = Constant.CHUANGSHEN_VEDIO_AD;
} else if (AppConfig.hytechVedioAdCount > 0) {
nextAdType = Constant.HYTECH_VEDIO_AD;
} else if (AppConfig.csjFullAdCount > 0) {
nextAdType = Constant.CSJ_FULL_AD;
}
return nextAdType;
}
......@@ -169,12 +169,7 @@ public class VedioAdingManager {
int weight = 0;
// 若没有视频完成数,不加入权重计算范围内
// 珊瑚>穿山甲激励>优量汇>多盟>mintegral>东方网>全屏>创神
if (AppConfig.shanhuAdCount > 0) {
weightList.add(new WeightBean(shanhuWeight, Constant.SHANHU_VEDIO_AD));
weight = weight + shanhuWeight;
LogUtil.d(TAG, "权重值:shanhuWeight:" + shanhuWeight);
}
// 穿山甲激励> 优量汇> 珊瑚>创神>多盟>mintegral>东方网>全屏
if (AppConfig.csjVedioAdCount > 0) {
weightList.add(new WeightBean(csjVedioWeight, Constant.CSJ_VEDIO_AD));
weight = weight + csjVedioWeight;
......@@ -185,6 +180,16 @@ public class VedioAdingManager {
weight = weight + ylhWeight;
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
}
if (AppConfig.shanhuAdCount > 0) {
weightList.add(new WeightBean(shanhuWeight, Constant.SHANHU_VEDIO_AD));
weight = weight + shanhuWeight;
LogUtil.d(TAG, "权重值:shanhuWeight:" + shanhuWeight);
}
if (AppConfig.chuangshenVedioAdCount > 0) {
weightList.add(new WeightBean(chuangshenWeight, Constant.CHUANGSHEN_VEDIO_AD));
weight = weight + chuangshenWeight;
LogUtil.d(TAG, "权重值:chuangshenWeight:" + chuangshenWeight);
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q && AppConfig.duomentVedioAdCount > 0) {
weightList.add(new WeightBean(domobWeight, Constant.DUOMENT_VEDIO_AD));
weight = weight + domobWeight;
......@@ -205,11 +210,6 @@ public class VedioAdingManager {
weight = weight + csjFullWeight;
LogUtil.d(TAG, "权重值:csjFullWeight:" + csjFullWeight);
}
if (AppConfig.chuangshenVedioAdCount > 0) {
weightList.add(new WeightBean(chuangshenWeight, Constant.CHUANGSHEN_VEDIO_AD));
weight = weight + chuangshenWeight;
LogUtil.d(TAG, "权重值:chuangshenWeight:" + chuangshenWeight);
}
// 权重随机
if (weightList != null && weightList.size() > 0 && weight > 0) {
......
......@@ -485,32 +485,32 @@ public interface LoanService {
builder.interceptors().add(okHttpInterceptor);
Retrofit retrofit;
if (BuildConfig.DEBUG) {
SPUtil spUtil = SPUtil.getInstance(context);
if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
spUtil.putString(Constant.LOCAL_IP, "http://39.97.65.143:9082/api-p1/");
}
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(spUtil.getString(Constant.LOCAL_IP))
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
} else {
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
}
// if (BuildConfig.DEBUG) {
// SPUtil spUtil = SPUtil.getInstance(context);
// if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
// spUtil.putString(Constant.LOCAL_IP, "http://39.97.65.143:9082/api-p1/");
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(spUtil.getString(Constant.LOCAL_IP))
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// } else {
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
return retrofit.create(LoanService.class);
......
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