Initial commit
This commit is contained in:
61
sources/com/ubt/jimu/user/presenter/FansPresenter.java
Normal file
61
sources/com/ubt/jimu/user/presenter/FansPresenter.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.entities.Fans;
|
||||
import com.ubt.jimu.user.contract.FansContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.FansContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class FansPresenter implements FansContract$Presenter {
|
||||
private FansContract$View a;
|
||||
private CompositeDisposable b;
|
||||
|
||||
public FansPresenter(Context context, FansContract$View fansContract$View) {
|
||||
this.a = fansContract$View;
|
||||
this.a.setPresenter(this);
|
||||
this.b = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.FansContract$Presenter
|
||||
public void d(long j, long j2) {
|
||||
this.a.a();
|
||||
UserRepository.a(j, j2, this.a.e(), this.a.f()).compose(RxSchedulers.a()).subscribe(new Observer<List<Fans>>() { // from class: com.ubt.jimu.user.presenter.FansPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(List<Fans> list) {
|
||||
FansPresenter.this.a.g(list);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
FansPresenter.this.a.onError();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
FansPresenter.this.b.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
d(this.a.m(), this.a.d());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.b.dispose();
|
||||
this.b.a();
|
||||
}
|
||||
}
|
63
sources/com/ubt/jimu/user/presenter/InterestPresenter.java
Normal file
63
sources/com/ubt/jimu/user/presenter/InterestPresenter.java
Normal file
@@ -0,0 +1,63 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.ubt.jimu.base.entities.Interest;
|
||||
import com.ubt.jimu.user.contract.InterestContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.InterestContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class InterestPresenter implements InterestContract$Presenter {
|
||||
private InterestContract$View a;
|
||||
private CompositeDisposable b;
|
||||
|
||||
public InterestPresenter(Context context, InterestContract$View interestContract$View) {
|
||||
this.a = interestContract$View;
|
||||
this.a.setPresenter(this);
|
||||
this.b = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
b(this.a.m(), this.a.d());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.b.dispose();
|
||||
this.b.a();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.InterestContract$Presenter
|
||||
public void b(long j, long j2) {
|
||||
UserRepository.b(j, j2, this.a.e(), this.a.f()).compose(RxSchedulers.a()).subscribe(new Observer<List<Interest>>() { // from class: com.ubt.jimu.user.presenter.InterestPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(List<Interest> list) {
|
||||
InterestPresenter.this.a.b(list);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
InterestPresenter.this.a.onError();
|
||||
Log.i("InterestPresenter", th.toString());
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
InterestPresenter.this.b.b(disposable);
|
||||
InterestPresenter.this.a.a();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
238
sources/com/ubt/jimu/user/presenter/LoginPresenter.java
Normal file
238
sources/com/ubt/jimu/user/presenter/LoginPresenter.java
Normal file
@@ -0,0 +1,238 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.SharePreferenceHelper;
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.User;
|
||||
import com.ubt.jimu.base.http.ApiClient;
|
||||
import com.ubt.jimu.base.http.ApiResultException;
|
||||
import com.ubt.jimu.base.http.IApiObserver;
|
||||
import com.ubt.jimu.base.http.service.UserService;
|
||||
import com.ubt.jimu.user.contract.LoginContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.LoginContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.DeviceUtils;
|
||||
import com.ubt.jimu.utils.LocaleUtils;
|
||||
import com.ubt.jimu.utils.LogUtils;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class LoginPresenter implements LoginContract$Presenter {
|
||||
private final CompositeDisposable a;
|
||||
private Context b;
|
||||
private LoginContract$View c;
|
||||
|
||||
public LoginPresenter(Context context, LoginContract$View loginContract$View) {
|
||||
this.b = context;
|
||||
this.c = loginContract$View;
|
||||
this.c.setPresenter(this);
|
||||
this.a = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.LoginContract$Presenter
|
||||
public void b(final String str, String str2) {
|
||||
boolean contains = str.contains("@");
|
||||
this.c.A();
|
||||
UserRepository.a(contains ? 1 : 0, str, str2).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new IApiObserver<User>(this.b) { // from class: com.ubt.jimu.user.presenter.LoginPresenter.1
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(User user) {
|
||||
super.onNext(user);
|
||||
if (user == null) {
|
||||
LoginPresenter.this.c.j(JimuApplication.l().getString(R.string.login_fail));
|
||||
} else {
|
||||
LoginPresenter.this.b(user, str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
LoginPresenter.this.c.j(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.LoginContract$Presenter
|
||||
public void a(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("accessToken", str);
|
||||
hashMap.put("appId", str2);
|
||||
hashMap.put("loginType", str3);
|
||||
hashMap.put("miniTvsId", str4);
|
||||
hashMap.put("openId", str5);
|
||||
hashMap.put("ubtAppId", String.valueOf(Constant.Base.APP_ID));
|
||||
hashMap.put("nickName", str6);
|
||||
hashMap.put(SocialConstants.PARAM_IMG_URL, str7);
|
||||
this.c.A();
|
||||
UserRepository.b(this.b, hashMap).compose(RxSchedulers.a()).subscribe(new IApiObserver<User>(this.b) { // from class: com.ubt.jimu.user.presenter.LoginPresenter.3
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(User user) {
|
||||
super.onNext(user);
|
||||
LoginPresenter.this.c.c(user);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
protected void onApiError(ApiResultException apiResultException) {
|
||||
LoginPresenter.this.c.j(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void b(final User user, String str) {
|
||||
((UserService) ApiClient.getService(UserService.class)).getImei(str).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.LoginPresenter.2
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (apiStatus == null) {
|
||||
return;
|
||||
}
|
||||
LogUtils.c("ApiStatus:" + apiStatus.getCode() + " " + apiStatus.getMessage());
|
||||
SharePreferenceHelper sharePreferenceHelper = new SharePreferenceHelper();
|
||||
String a = DeviceUtils.a(JimuApplication.l());
|
||||
if (TextUtils.isEmpty(apiStatus.getMessage())) {
|
||||
sharePreferenceHelper.put(SharePreferenceHelper.AUTHOR_TOKEN, user.getToken());
|
||||
LoginPresenter loginPresenter = LoginPresenter.this;
|
||||
loginPresenter.a(user, DeviceUtils.a(loginPresenter.b));
|
||||
} else if (TextUtils.isEmpty(a) || !a.equals(apiStatus.getMessage())) {
|
||||
sharePreferenceHelper.put(SharePreferenceHelper.AUTHOR_TOKEN, "");
|
||||
LoginPresenter.this.c.b(user);
|
||||
} else {
|
||||
user.setUserImei(apiStatus.getMessage());
|
||||
LoginPresenter.this.c.c(user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
LoginPresenter.this.c.j(th.getMessage());
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.LoginContract$Presenter
|
||||
public void b() {
|
||||
Observable.create(new ObservableOnSubscribe<String>() { // from class: com.ubt.jimu.user.presenter.LoginPresenter.5
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(ObservableEmitter<String> observableEmitter) throws Exception {
|
||||
observableEmitter.onNext(LocaleUtils.a(LoginPresenter.this.b));
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}).compose(RxSchedulers.a()).subscribe(new Observer<String>() { // from class: com.ubt.jimu.user.presenter.LoginPresenter.4
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(String str) {
|
||||
LoginPresenter.this.c.c(str);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.LoginContract$Presenter
|
||||
public void a(final User user, String str) {
|
||||
UserRepository.b(str).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.LoginPresenter.6
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
String message = apiStatus.getMessage();
|
||||
if (!TextUtils.isEmpty(message)) {
|
||||
user.setUserImei(message);
|
||||
}
|
||||
LoginPresenter.this.c.c(user);
|
||||
LogUtils.c("GET iMEI 成功" + apiStatus.getCode() + " " + apiStatus.getMessage());
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
LoginPresenter.this.c.c(user);
|
||||
LogUtils.c("GET iMEI ERROR");
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.LoginContract$Presenter
|
||||
public void a(String str, String str2, String str3, String str4) {
|
||||
UserRepository.a(str, str2, str3, str4).compose(RxSchedulers.a()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.LoginPresenter.7
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (apiStatus == null) {
|
||||
LoginPresenter.this.c.j("");
|
||||
} else {
|
||||
LoginPresenter.this.c.d(apiStatus.getCode() == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
LoginPresenter.this.c.j("");
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
LoginPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
58
sources/com/ubt/jimu/user/presenter/PostPresenter.java
Normal file
58
sources/com/ubt/jimu/user/presenter/PostPresenter.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.entities.MyPostListEntities;
|
||||
import com.ubt.jimu.user.contract.PostContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.PostContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PostPresenter implements PostContract$Presenter {
|
||||
private PostContract$View a;
|
||||
private CompositeDisposable b;
|
||||
|
||||
public PostPresenter(Context context, PostContract$View postContract$View) {
|
||||
this.a = postContract$View;
|
||||
this.a.setPresenter(this);
|
||||
this.b = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
a(this.a.m());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.b.dispose();
|
||||
this.b.a();
|
||||
}
|
||||
|
||||
public void a(long j) {
|
||||
UserRepository.a(j).compose(RxSchedulers.a()).subscribe(new Observer<MyPostListEntities>() { // from class: com.ubt.jimu.user.presenter.PostPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(MyPostListEntities myPostListEntities) {
|
||||
PostPresenter.this.a.n(myPostListEntities.getRecords());
|
||||
PostPresenter.this.a.onSuccess();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
PostPresenter.this.b.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
89
sources/com/ubt/jimu/user/presenter/PraisePresenter.java
Normal file
89
sources/com/ubt/jimu/user/presenter/PraisePresenter.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.ubt.jimu.base.entities.FollowEntities;
|
||||
import com.ubt.jimu.base.entities.PraiseBean;
|
||||
import com.ubt.jimu.base.http.ApiResultException;
|
||||
import com.ubt.jimu.base.http.IApiObserver;
|
||||
import com.ubt.jimu.user.contract.PraiseContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.PraiseContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class PraisePresenter implements PraiseContract$Presenter {
|
||||
private Context a;
|
||||
private PraiseContract$View b;
|
||||
private CompositeDisposable c;
|
||||
|
||||
public PraisePresenter(Context context, PraiseContract$View praiseContract$View) {
|
||||
this.a = context;
|
||||
this.b = praiseContract$View;
|
||||
this.b.setPresenter(this);
|
||||
this.c = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.PraiseContract$Presenter
|
||||
public void addPraise(int i) {
|
||||
UserRepository.a(i).compose(RxSchedulers.a()).subscribe(new IApiObserver<FollowEntities>(this.a) { // from class: com.ubt.jimu.user.presenter.PraisePresenter.2
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(FollowEntities followEntities) {
|
||||
super.onNext(followEntities);
|
||||
PraisePresenter.this.b.a(followEntities);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
PraisePresenter.this.b.b(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
PraisePresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
a(this.b.d(), this.b.e(), XStream.PRIORITY_VERY_HIGH);
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.c.dispose();
|
||||
this.c.a();
|
||||
}
|
||||
|
||||
public void a(long j, int i, int i2) {
|
||||
this.b.a();
|
||||
UserRepository.a(j, i, i2).compose(RxSchedulers.a()).subscribe(new Observer<List<PraiseBean.Praise>>() { // from class: com.ubt.jimu.user.presenter.PraisePresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(List<PraiseBean.Praise> list) {
|
||||
PraisePresenter.this.b.q(list);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
PraisePresenter.this.b.b("");
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
PraisePresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
62
sources/com/ubt/jimu/user/presenter/RankPresenter.java
Normal file
62
sources/com/ubt/jimu/user/presenter/RankPresenter.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.entities.Rank;
|
||||
import com.ubt.jimu.user.contract.RankContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.RankContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class RankPresenter implements RankContract$Presenter {
|
||||
private RankContract$View a;
|
||||
private CompositeDisposable b;
|
||||
|
||||
public RankPresenter(Context context, RankContract$View rankContract$View) {
|
||||
this.a = rankContract$View;
|
||||
this.a.setPresenter(this);
|
||||
this.b = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RankContract$Presenter
|
||||
public void c(long j) {
|
||||
this.a.a();
|
||||
UserRepository.b(j).compose(RxSchedulers.a()).subscribe(new Observer<List<Rank>>() { // from class: com.ubt.jimu.user.presenter.RankPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(List<Rank> list) {
|
||||
RankPresenter.this.a.l(list);
|
||||
RankPresenter.this.a.onSuccess();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
RankPresenter.this.a.onError();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
RankPresenter.this.b.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
c(this.a.d());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.b.dispose();
|
||||
this.b.a();
|
||||
}
|
||||
}
|
387
sources/com/ubt/jimu/user/presenter/RegisterPresenter.java
Normal file
387
sources/com/ubt/jimu/user/presenter/RegisterPresenter.java
Normal file
@@ -0,0 +1,387 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.facebook.AccessToken;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.cache.SharePreferenceHelper;
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.base.entities.User;
|
||||
import com.ubt.jimu.base.entities.UserDetailInfo;
|
||||
import com.ubt.jimu.base.http.ApiResultException;
|
||||
import com.ubt.jimu.base.http.IApiObserver;
|
||||
import com.ubt.jimu.push.JimuPushMessage;
|
||||
import com.ubt.jimu.user.contract.RegisterContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.RegisterContract$View;
|
||||
import com.ubt.jimu.user.model.EmailCheckMsg;
|
||||
import com.ubt.jimu.user.model.RefHolder;
|
||||
import com.ubt.jimu.user.presenter.RegisterPresenter;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.DeviceUtils;
|
||||
import com.ubt.jimu.utils.LocaleUtils;
|
||||
import com.ubt.jimu.utils.Md5Utils;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import com.ubtech.utils.XLog;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class RegisterPresenter implements RegisterContract$Presenter {
|
||||
private Context a;
|
||||
private RegisterContract$View b;
|
||||
private CompositeDisposable c = new CompositeDisposable();
|
||||
private Handler d;
|
||||
private HandlerThread e;
|
||||
|
||||
public RegisterPresenter(Context context, RegisterContract$View registerContract$View) {
|
||||
this.a = context.getApplicationContext();
|
||||
this.b = registerContract$View;
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
this.e = new HandlerThread("check parent email theread");
|
||||
this.e.start();
|
||||
this.d = new Handler(this.e.getLooper());
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.c.dispose();
|
||||
this.c.a();
|
||||
Handler handler = this.d;
|
||||
if (handler != null) {
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
this.d = null;
|
||||
}
|
||||
HandlerThread handlerThread = this.e;
|
||||
if (handlerThread != null) {
|
||||
handlerThread.quit();
|
||||
this.e = null;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void c(String str, String str2) {
|
||||
Cache.getInstance().getSettings().put(SharePreferenceHelper.SP_KEY_LAST_PARENT_EMAIL, str);
|
||||
b(str, str2);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void d(String str, String str2) {
|
||||
this.b.F();
|
||||
UserRepository.a(this.a, str, Md5Utils.a(str2)).compose(RxSchedulers.a()).subscribe(new Observer<User>() { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.6
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(User user) {
|
||||
RegisterPresenter.this.b.a(user);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
RegisterPresenter.this.b.H();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void b(String str, String str2) {
|
||||
UserRepository.a(str, str2).compose(RxSchedulers.a()).subscribe(new AnonymousClass5(this.a, str, str2));
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void a(final String str, final String str2, String str3, String str4, String str5) {
|
||||
boolean contains = str3.contains("@");
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("account", str3);
|
||||
hashMap.put("accountType", String.valueOf(contains ? 1 : 0));
|
||||
hashMap.put("appId", String.valueOf(Constant.Base.APP_ID));
|
||||
hashMap.put("password", Md5Utils.a(str4));
|
||||
hashMap.put("captcha", str5);
|
||||
this.b.Q();
|
||||
UserRepository.a(this.a, hashMap).compose(RxSchedulers.a()).subscribe(new IApiObserver<User>(this.a) { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.1
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(User user) {
|
||||
super.onNext(user);
|
||||
RegisterPresenter.this.b.d(user);
|
||||
RegisterPresenter.this.a(str, str2);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
RegisterPresenter.this.b.k(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void b() {
|
||||
Observable.create(new ObservableOnSubscribe<String>() { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.8
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(ObservableEmitter<String> observableEmitter) throws Exception {
|
||||
observableEmitter.onNext(LocaleUtils.a(RegisterPresenter.this.a));
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}).compose(RxSchedulers.a()).subscribe(new Observer<String>() { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.7
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(String str) {
|
||||
RegisterPresenter.this.b.c(str);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* renamed from: com.ubt.jimu.user.presenter.RegisterPresenter$5, reason: invalid class name */
|
||||
class AnonymousClass5 extends IApiObserver<EmailCheckMsg> {
|
||||
final /* synthetic */ String a;
|
||||
final /* synthetic */ String b;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
AnonymousClass5(Context context, String str, String str2) {
|
||||
super(context);
|
||||
this.a = str;
|
||||
this.b = str2;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(EmailCheckMsg emailCheckMsg) {
|
||||
super.onNext(emailCheckMsg);
|
||||
ALog.a("RegPresenter").e("getEmailCheckState:" + emailCheckMsg, new Object[0]);
|
||||
if (emailCheckMsg.isEmailChecked()) {
|
||||
RegisterPresenter.this.b.a(RegisterPresenter.this.a);
|
||||
Cache.getInstance().getSettings().put(SharePreferenceHelper.SP_KEY_LAST_PARENT_EMAIL, "");
|
||||
if (RegisterPresenter.this.d == null) {
|
||||
return;
|
||||
}
|
||||
RegisterPresenter.this.d.removeCallbacksAndMessages(null);
|
||||
return;
|
||||
}
|
||||
if (RegisterPresenter.this.d != null) {
|
||||
ALog.a("RegPresenter").e("postDelay check email", new Object[0]);
|
||||
Handler handler = RegisterPresenter.this.d;
|
||||
final String str = this.a;
|
||||
final String str2 = this.b;
|
||||
handler.postDelayed(new Runnable() { // from class: com.ubt.jimu.user.presenter.b
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
RegisterPresenter.AnonymousClass5.this.b(str, str2);
|
||||
}
|
||||
}, 4000L);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void b(String str, String str2) {
|
||||
RegisterPresenter.this.b(str, str2);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
if (RegisterPresenter.this.d != null) {
|
||||
ALog.a("RegPresenter").e("postDelay check email", new Object[0]);
|
||||
Handler handler = RegisterPresenter.this.d;
|
||||
final String str = this.a;
|
||||
final String str2 = this.b;
|
||||
handler.postDelayed(new Runnable() { // from class: com.ubt.jimu.user.presenter.a
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
RegisterPresenter.AnonymousClass5.this.a(str, str2);
|
||||
}
|
||||
}, 4000L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
|
||||
public /* synthetic */ void a(String str, String str2) {
|
||||
RegisterPresenter.this.b(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void a(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("accessToken", str);
|
||||
hashMap.put("appId", str2);
|
||||
hashMap.put("loginType", str3);
|
||||
hashMap.put("miniTvsId", str4);
|
||||
hashMap.put("openId", str5);
|
||||
hashMap.put("ubtAppId", String.valueOf(Constant.Base.APP_ID));
|
||||
hashMap.put("nickName", str6);
|
||||
hashMap.put(SocialConstants.PARAM_IMG_URL, str7);
|
||||
this.b.Q();
|
||||
UserRepository.b(this.a, hashMap).compose(RxSchedulers.a()).subscribe(new IApiObserver<User>(this.a) { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.2
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(User user) {
|
||||
super.onNext(user);
|
||||
RegisterPresenter.this.b.d(user);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
protected void onApiError(ApiResultException apiResultException) {
|
||||
RegisterPresenter.this.b.k(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void a(String str, int i) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
XLog.b("RegPresenter", "account is null or empty!");
|
||||
return;
|
||||
}
|
||||
boolean contains = str.contains("@");
|
||||
this.b.T();
|
||||
UserRepository.a(str, contains ? 1 : 0, i).compose(RxSchedulers.a()).subscribe(new IApiObserver<ApiStatus>(this.a) { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.3
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
super.onNext(apiStatus);
|
||||
RegisterPresenter.this.b.b(apiStatus);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
RegisterPresenter.this.b.e(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.RegisterContract$Presenter
|
||||
public void a(String str, final String str2, String str3, boolean z) {
|
||||
Map<String, String> b;
|
||||
RefHolder.a(str2);
|
||||
try {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("appSource", "Jimu");
|
||||
hashMap.put("appType", "2");
|
||||
hashMap.put("deviceId", DeviceUtils.a(this.a.getApplicationContext()));
|
||||
hashMap.put("nickName", str);
|
||||
hashMap.put("email", str2);
|
||||
hashMap.put(JimuPushMessage.KEY_USER_BIRTHDAY, str3);
|
||||
hashMap.put("isCheckEmail", z ? "1" : "0");
|
||||
if (!z && (b = RefHolder.b()) != null) {
|
||||
hashMap.put("appId", b.get("ubtsocial_app_id"));
|
||||
hashMap.put("loginType", b.get("social_type"));
|
||||
hashMap.put("openId", b.get("ubtsocial_user_id"));
|
||||
hashMap.put("accessToken", b.get(AccessToken.ACCESS_TOKEN_KEY));
|
||||
}
|
||||
UserRepository.a(hashMap).compose(RxSchedulers.a()).subscribe(new IApiObserver<ApiStatus>(this.a) { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.4
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
super.onNext(apiStatus);
|
||||
Log.i("sendGuardianEmail", apiStatus.getMessage());
|
||||
RegisterPresenter.this.b.f(apiStatus);
|
||||
RegisterPresenter registerPresenter = RegisterPresenter.this;
|
||||
registerPresenter.c(str2, DeviceUtils.a(registerPresenter.a));
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
RegisterPresenter.this.b.i(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.b.i(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String str, String str2) {
|
||||
HashMap hashMap = new HashMap();
|
||||
if (!TextUtils.isEmpty(str2)) {
|
||||
hashMap.put("countryName", str2);
|
||||
}
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
hashMap.put("countryCode", str);
|
||||
}
|
||||
if (hashMap.size() < 1) {
|
||||
return;
|
||||
}
|
||||
UserRepository.b(hashMap).compose(RxSchedulers.a()).subscribe(new Observer<UserDetailInfo>() { // from class: com.ubt.jimu.user.presenter.RegisterPresenter.9
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(UserDetailInfo userDetailInfo) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
RegisterPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
121
sources/com/ubt/jimu/user/presenter/ResetPasswordPresenter.java
Normal file
121
sources/com/ubt/jimu/user/presenter/ResetPasswordPresenter.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.entities.TokenBean;
|
||||
import com.ubt.jimu.base.http.ApiResultException;
|
||||
import com.ubt.jimu.base.http.IApiObserver;
|
||||
import com.ubt.jimu.user.contract.ResetPasswordContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.ResetPasswordContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.LocaleUtils;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Function;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class ResetPasswordPresenter implements ResetPasswordContract$Presenter {
|
||||
private Context a;
|
||||
private ResetPasswordContract$View b;
|
||||
private CompositeDisposable c;
|
||||
|
||||
public ResetPasswordPresenter(Context context, ResetPasswordContract$View resetPasswordContract$View) {
|
||||
this.a = context;
|
||||
this.b = resetPasswordContract$View;
|
||||
this.b.setPresenter(this);
|
||||
this.c = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.ResetPasswordContract$Presenter
|
||||
public void a(String str, int i) {
|
||||
UserRepository.a(str, str.contains("@") ? 1 : 0, i).compose(RxSchedulers.a()).subscribe(new IApiObserver<ApiStatus>(this.a) { // from class: com.ubt.jimu.user.presenter.ResetPasswordPresenter.1
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
super.onNext(apiStatus);
|
||||
ResetPasswordPresenter.this.b.b(apiStatus);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
ResetPasswordPresenter.this.b.e(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
ResetPasswordPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.ResetPasswordContract$Presenter
|
||||
public void b() {
|
||||
Observable.create(new ObservableOnSubscribe<String>() { // from class: com.ubt.jimu.user.presenter.ResetPasswordPresenter.5
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(ObservableEmitter<String> observableEmitter) throws Exception {
|
||||
observableEmitter.onNext(LocaleUtils.a(ResetPasswordPresenter.this.a));
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}).compose(RxSchedulers.a()).subscribe(new Observer<String>() { // from class: com.ubt.jimu.user.presenter.ResetPasswordPresenter.4
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(String str) {
|
||||
ResetPasswordPresenter.this.b.c(str);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
ResetPasswordPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.ResetPasswordContract$Presenter
|
||||
public void a(String str, final String str2, String str3) {
|
||||
UserRepository.a(str, str3, str.contains("@") ? 1 : 0).flatMap(new Function<TokenBean, Observable<ApiStatus>>(this) { // from class: com.ubt.jimu.user.presenter.ResetPasswordPresenter.3
|
||||
@Override // io.reactivex.functions.Function
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Observable<ApiStatus> apply(TokenBean tokenBean) throws Exception {
|
||||
return UserRepository.a(str2, tokenBean.getToken(), String.valueOf(tokenBean.getUserId()));
|
||||
}
|
||||
}).compose(RxSchedulers.a()).subscribe(new IApiObserver<ApiStatus>(this.a) { // from class: com.ubt.jimu.user.presenter.ResetPasswordPresenter.2
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
super.onNext(apiStatus);
|
||||
ResetPasswordPresenter.this.b.d(apiStatus);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver
|
||||
public void onApiError(ApiResultException apiResultException) {
|
||||
ResetPasswordPresenter.this.b.g(apiResultException.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
ResetPasswordPresenter.this.b.g(th.getMessage());
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.IApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
ResetPasswordPresenter.this.c.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
159
sources/com/ubt/jimu/user/presenter/SettingPresenter.java
Normal file
159
sources/com/ubt/jimu/user/presenter/SettingPresenter.java
Normal file
@@ -0,0 +1,159 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import com.ubt.jimu.JimuApplication;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.base.cache.SharePreferenceHelper;
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.base.entities.Robot;
|
||||
import com.ubt.jimu.community.view.WebViewShopActivity;
|
||||
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
||||
import com.ubt.jimu.user.contract.SettingContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.SettingContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.user.view.setting.AboutJimuActivity;
|
||||
import com.ubt.jimu.user.view.setting.FeedbackActivity;
|
||||
import com.ubt.jimu.user.view.setting.SettingActivity;
|
||||
import com.ubt.jimu.user.view.setting.TeachActivity;
|
||||
import com.ubt.jimu.utils.ThreadManagerUtils;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class SettingPresenter implements SettingContract$Presenter {
|
||||
private SharePreferenceHelper a;
|
||||
private Context b;
|
||||
private SettingContract$View c;
|
||||
private CompositeDisposable d = new CompositeDisposable();
|
||||
|
||||
public SettingPresenter(Context context, SettingContract$View settingContract$View) {
|
||||
this.b = context;
|
||||
this.c = settingContract$View;
|
||||
this.c.setPresenter(this);
|
||||
this.a = new SharePreferenceHelper();
|
||||
}
|
||||
|
||||
public void c(View view) {
|
||||
view.setPressed(true);
|
||||
UnityActivity.startUnityActivity((SettingActivity) this.b, (Robot) null, 1, -1, UnityActivity.BLOCKLY_TYPE_NONE);
|
||||
}
|
||||
|
||||
public void d(View view) {
|
||||
view.setPressed(true);
|
||||
this.a.put(SharePreferenceHelper.SP_KEY_WIFI_VIEW, Boolean.valueOf(this.c.s()));
|
||||
}
|
||||
|
||||
public void e(View view) {
|
||||
view.setPressed(true);
|
||||
String g = JimuApplication.l().g();
|
||||
if (!"zh-hans".equals(g)) {
|
||||
g = "en";
|
||||
}
|
||||
String format = String.format("https://video.ubtrobot.com/jimu/product/h5/QA/index_%s.html", g);
|
||||
Context context = this.b;
|
||||
WebViewShopActivity.a(context, context.getString(R.string.setting_qa), format, "", 0);
|
||||
}
|
||||
|
||||
public void f(View view) {
|
||||
view.setPressed(true);
|
||||
this.a.put(SharePreferenceHelper.SP_KEY_INFO_TO, Boolean.valueOf(this.c.t()));
|
||||
}
|
||||
|
||||
public void g(View view) {
|
||||
view.setPressed(true);
|
||||
TeachActivity.start(this.b);
|
||||
}
|
||||
|
||||
public void h(View view) {
|
||||
view.setPressed(true);
|
||||
FeedbackActivity.start(this.b);
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.a.put(SharePreferenceHelper.SP_KEY_AUTO_CONNECT, Boolean.valueOf(z));
|
||||
}
|
||||
|
||||
public void b(View view) {
|
||||
view.setPressed(true);
|
||||
this.a.put(SharePreferenceHelper.SP_KEY_ELECTRICITY_PROTECT, Boolean.valueOf(this.c.r()));
|
||||
}
|
||||
|
||||
public void a(View view) {
|
||||
view.setPressed(true);
|
||||
AboutJimuActivity.start(this.b);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
UserRepository.a().observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.SettingPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (apiStatus == null || apiStatus.getCode() != 0) {
|
||||
SettingPresenter.this.c.h();
|
||||
} else {
|
||||
SettingPresenter.this.c.a(apiStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
th.printStackTrace();
|
||||
SettingPresenter.this.c.h();
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
SettingPresenter.this.d.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void a(String str) {
|
||||
UserRepository.a(str).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.SettingPresenter.2
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (SettingPresenter.this.c == null) {
|
||||
return;
|
||||
}
|
||||
if (apiStatus == null) {
|
||||
SettingPresenter.this.c.f("");
|
||||
} else if (apiStatus.getCode() == 0) {
|
||||
SettingPresenter.this.c.c(apiStatus);
|
||||
} else {
|
||||
SettingPresenter.this.c.f(apiStatus.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
if (SettingPresenter.this.c != null) {
|
||||
SettingPresenter.this.c.f("");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
SettingPresenter.this.d.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void a() {
|
||||
ThreadManagerUtils.a().a();
|
||||
this.d.dispose();
|
||||
this.d.a();
|
||||
}
|
||||
}
|
127
sources/com/ubt/jimu/user/presenter/UserInfoPresenter.java
Normal file
127
sources/com/ubt/jimu/user/presenter/UserInfoPresenter.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
||||
import com.ubt.jimu.base.entities.UserExtraInfo;
|
||||
import com.ubt.jimu.base.http.ApiObserver;
|
||||
import com.ubt.jimu.transport3.DiyTransportServiceImpl;
|
||||
import com.ubt.jimu.transport3.dao.DiyDBModelDBHandler;
|
||||
import com.ubt.jimu.user.contract.UserInfoContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.UserInfoContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import com.ubt.jimu.utils.RxSchedulers;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class UserInfoPresenter implements UserInfoContract$Presenter {
|
||||
private CompositeDisposable a;
|
||||
private UserInfoContract$View b;
|
||||
|
||||
public UserInfoPresenter(Context context, UserInfoContract$View userInfoContract$View) {
|
||||
this.b = userInfoContract$View;
|
||||
this.b.setPresenter(this);
|
||||
this.a = new CompositeDisposable();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void subscribe() {
|
||||
long d = this.b.d();
|
||||
a(this.b.S(), d);
|
||||
if (String.valueOf(d).equals(Cache.getInstance().getUserId())) {
|
||||
a(String.valueOf(d));
|
||||
} else {
|
||||
this.b.E();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubtech.presenter.BasePresenter
|
||||
public void unSubscribe() {
|
||||
this.a.dispose();
|
||||
this.a.a();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void b(final String str) {
|
||||
Observable.create(new ObservableOnSubscribe<List<DiyDBModel>>(this) { // from class: com.ubt.jimu.user.presenter.UserInfoPresenter.5
|
||||
@Override // io.reactivex.ObservableOnSubscribe
|
||||
public void subscribe(ObservableEmitter<List<DiyDBModel>> observableEmitter) {
|
||||
observableEmitter.onNext(DiyDBModelDBHandler.getInstance().getUserDiyModels(str));
|
||||
observableEmitter.onComplete();
|
||||
}
|
||||
}).subscribeOn(Schedulers.b()).observeOn(AndroidSchedulers.a()).subscribe(new Observer<List<DiyDBModel>>() { // from class: com.ubt.jimu.user.presenter.UserInfoPresenter.6
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(List<DiyDBModel> list) {
|
||||
UserInfoPresenter.this.b.r(list);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
UserInfoPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.UserInfoContract$Presenter
|
||||
public void a(long j, long j2) {
|
||||
UserRepository.a(j, j2).compose(RxSchedulers.a()).subscribe(new Observer<UserExtraInfo>() { // from class: com.ubt.jimu.user.presenter.UserInfoPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(UserExtraInfo userExtraInfo) {
|
||||
UserInfoPresenter.this.b.a(userExtraInfo);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
UserInfoPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void a(final String str) {
|
||||
DiyTransportServiceImpl.getInstance().getModels(str, new ApiObserver<List<DiyDBModel>>(null) { // from class: com.ubt.jimu.user.presenter.UserInfoPresenter.4
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
super.onError(th);
|
||||
UserInfoPresenter.this.b(str);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
super.onSubscribe(disposable);
|
||||
UserInfoPresenter.this.a.b(disposable);
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.http.ApiObserver, io.reactivex.Observer
|
||||
public void onNext(List<DiyDBModel> list) {
|
||||
super.onNext((AnonymousClass4) list);
|
||||
UserInfoPresenter.this.b.r(list);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
80
sources/com/ubt/jimu/user/presenter/VerifyPresenter.java
Normal file
80
sources/com/ubt/jimu/user/presenter/VerifyPresenter.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.ubt.jimu.user.presenter;
|
||||
|
||||
import com.ubt.jimu.base.entities.ApiStatus;
|
||||
import com.ubt.jimu.course.repository.CourseResult;
|
||||
import com.ubt.jimu.user.contract.VerifyContract$Presenter;
|
||||
import com.ubt.jimu.user.contract.VerifyContract$View;
|
||||
import com.ubt.jimu.user.repository.UserRepository;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class VerifyPresenter implements VerifyContract$Presenter {
|
||||
private final CompositeDisposable a = new CompositeDisposable();
|
||||
private VerifyContract$View b;
|
||||
|
||||
public VerifyPresenter(VerifyContract$View verifyContract$View) {
|
||||
this.b = verifyContract$View;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.VerifyContract$Presenter
|
||||
public void getCaptcha(String str, String str2, String str3, String str4, String str5) {
|
||||
UserRepository.a(str, str2, str3, str4, str5).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.VerifyPresenter.1
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (apiStatus == null || apiStatus.getCode() != 0) {
|
||||
VerifyPresenter.this.b.c(new Exception("获取验证码失败"));
|
||||
} else {
|
||||
VerifyPresenter.this.b.e(apiStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
VerifyPresenter.this.b.c(th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
VerifyPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.user.contract.VerifyContract$Presenter
|
||||
public void a(String str, String str2) {
|
||||
UserRepository.b(str, str2).observeOn(AndroidSchedulers.a()).subscribeOn(Schedulers.b()).subscribe(new Observer<ApiStatus>() { // from class: com.ubt.jimu.user.presenter.VerifyPresenter.2
|
||||
@Override // io.reactivex.Observer
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void onNext(ApiStatus apiStatus) {
|
||||
if (apiStatus.getCode() == 0 || CourseResult.SUCCESS.equals(apiStatus.getMessage())) {
|
||||
VerifyPresenter.this.b.g(apiStatus);
|
||||
} else {
|
||||
VerifyPresenter.this.b.b(new Exception("验证失败"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onError(Throwable th) {
|
||||
VerifyPresenter.this.b.b(th);
|
||||
}
|
||||
|
||||
@Override // io.reactivex.Observer
|
||||
public void onSubscribe(Disposable disposable) {
|
||||
VerifyPresenter.this.a.b(disposable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user