调整战令接口
调整战令购买等级最大值 新增战令统计直播间发送消息接口
This commit is contained in:
@@ -29,6 +29,10 @@ public class BattlePassUserInfoBean extends BaseModel{
|
||||
private String endTime;
|
||||
@SerializedName("battle_pass_status")
|
||||
private boolean battlePassStatus;
|
||||
@SerializedName("max_level_exp")
|
||||
private long maxLevelExp;
|
||||
@SerializedName("max_level")
|
||||
private int maxLevel;
|
||||
|
||||
private List<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type;
|
||||
|
||||
@@ -153,4 +157,20 @@ public class BattlePassUserInfoBean extends BaseModel{
|
||||
public void setBattlePassStatus(boolean battlePassStatus) {
|
||||
this.battlePassStatus = battlePassStatus;
|
||||
}
|
||||
|
||||
public long getMaxLevelExp() {
|
||||
return maxLevelExp;
|
||||
}
|
||||
|
||||
public void setMaxLevelExp(long maxLevelExp) {
|
||||
this.maxLevelExp = maxLevelExp;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
public void setMaxLevel(int maxLevel) {
|
||||
this.maxLevel = maxLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -25,15 +27,17 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
private String buyExp = "100", currentLevel, balance;
|
||||
private ProgressBar progressBar;
|
||||
private OrderLevelCallback orderLevelCallback;
|
||||
private long maxExp;
|
||||
|
||||
public OrderLevelPopupWindow(@NonNull Context context,
|
||||
int mCurrentExperience, int mTotalExperience,
|
||||
String mCurrentLevel, String mBalance, OrderLevelCallback mOrderLevelCallback) {
|
||||
String mCurrentLevel, String mBalance,long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
super(context);
|
||||
currentExperience = mCurrentExperience;
|
||||
totalExperience = mTotalExperience;
|
||||
currentLevel = mCurrentLevel;
|
||||
balance = mBalance;
|
||||
this.maxExp=maxExp;
|
||||
orderLevelCallback = mOrderLevelCallback;
|
||||
}
|
||||
|
||||
@@ -72,11 +76,13 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp < 10000) {
|
||||
if (exp < maxExp && exp < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevel.setText(buyExp);
|
||||
}else if(exp>=maxExp){
|
||||
ToastUtil.show(WordUtil.isNewZh()?"经验已滿":"Experience full");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1131,4 +1131,6 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<BattlePassPoints>>> getBattlePassPoints();
|
||||
@GET("/api/public/?service=Livebattlepass.battlePassRule")
|
||||
Observable<ResponseModel<String>> battlePassRule();
|
||||
@GET("/api/public/?service=Livebattlepass.addChatCount")
|
||||
Observable<ResponseModel<List<BaseModel>>> addChatCount();
|
||||
}
|
||||
|
||||
@@ -2757,7 +2757,27 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void addChatCount(HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addChatCount()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user