Commit fb4ea988 authored by mengcuiguang's avatar mengcuiguang

调整优先级

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