i自然 v1.5.2版本的 MD5 值为:4186de3133535afd3ad8a76e7e4d0eff
以下内容为反编译后的 IntegralModel.java 源代码,内容仅作参考
package com.mnr.app.home.model;
import androidx.lifecycle.MutableLiveData;
import com.mnr.app.base.model.BaseAppModel;
import com.mnr.app.home.bean.IntegralBean;
import com.mnr.app.home.bean.IntegralEvent;
import com.mnr.app.net.BaseObserver;
import com.mnr.app.net.HttpService;
import com.mnr.app.user.model.UserModel;
import com.mnr.app.utils.IntegralToastUtils;
import com.mnr.dependencies.Utils.Loger;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.schedulers.Schedulers;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.ResponseBody;
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004J\u001c\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u00062\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\t¨\u0006\u000b"}, d2 = {"Lcom/mnr/app/home/model/IntegralModel;", "Lcom/mnr/app/base/model/BaseAppModel;", "()V", "getIntegral", "", "setIntegralEvent", "Landroidx/lifecycle/MutableLiveData;", "Lcom/mnr/app/home/bean/IntegralBean;", "integralType", "", "eventObj", "app_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class IntegralModel extends BaseAppModel {
public final void getIntegral() {
reGetUserInfo();
if (getMUid() == 0) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("userID", Integer.valueOf(getMUid()));
hashMap.put("userIDSign", getMUidSign());
Observable observeOn = HttpService.INSTANCE.getApiService().get("https://api.iziran.net/integralmall/myInfo", hashMap).map(new Function() {
@Override
public final T apply(ResponseBody responseBody) {
return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) IntegralBean.class);
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
Intrinsics.checkNotNullExpressionValue(observeOn, "apiService.get(url, map)…dSchedulers.mainThread())");
observeOn.subscribe(new BaseObserver<IntegralBean>(this) {
{
super(this);
}
@Override
public void onNextBase(IntegralBean t) {
Loger.e("", "integral:onNextBase -=======onNextBase");
UserModel.INSTANCE.getIntegralLiveData().setValue(t);
}
@Override
public void onErrorBase(Throwable e) {
StringBuilder sb = new StringBuilder();
sb.append("integral:onNextBase:");
sb.append(e != null ? e.getMessage() : null);
sb.append(' ');
Loger.e("", sb.toString());
IntegralBean integralBean = new IntegralBean();
integralBean.setMsg(e != null ? e.getMessage() : null);
UserModel.INSTANCE.getIntegralLiveData().setValue(integralBean);
}
});
}
public final MutableLiveData<IntegralBean> setIntegralEvent(final int integralType, int eventObj) {
MutableLiveData<IntegralBean> mutableLiveData = new MutableLiveData<>();
HashMap hashMap = new HashMap();
reGetUserInfo();
HashMap hashMap2 = hashMap;
hashMap2.put("siteID", 1);
hashMap2.put("integralType", Integer.valueOf(integralType));
hashMap2.put("eventObj", Integer.valueOf(eventObj));
hashMap2.put("userID", Integer.valueOf(getMUid()));
hashMap2.put("userIDSign", getMUidSign());
Observable observeOn = HttpService.INSTANCE.getApiService().post("https://api.iziran.net/appevent/integralEvent", hashMap2).map(new Function() {
@Override
public final T apply(ResponseBody responseBody) {
return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) IntegralEvent.class);
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
Intrinsics.checkNotNullExpressionValue(observeOn, "apiService.post(url, map…dSchedulers.mainThread())");
observeOn.subscribe(new BaseObserver<IntegralEvent>(this) {
{
super(this);
}
@Override
public void onNextBase(IntegralEvent t) {
if (!(t != null && t.isSuccess()) || t.getIntegral() <= 0) {
return;
}
IntegralToastUtils.get().showShort(integralType, t.getIntegral());
}
@Override
public void onErrorBase(Throwable e) {
Loger.e("123", "IntegralModel.onErrorBase");
}
});
return mutableLiveData;
}
}