空格
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
package com.xscm.modulelogin.present;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.oss.OSSOperUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class ImproveInfoPresenter extends BasePresenter<ImproveInfoContacts.View> implements ImproveInfoContacts.IImproveInfoPre {
|
||||
public ImproveInfoPresenter(ImproveInfoContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadFile(File file, int type) {
|
||||
MvpRef.get().showLoadings("上传中...");
|
||||
String url = OSSOperUtils.getPath(file, type);
|
||||
OSSOperUtils.newInstance().putObjectMethod(url, file.getPath(), new OSSOperUtils.OssCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (isViewAttach()) {
|
||||
MvpRef.get().disLoadings();
|
||||
MvpRef.get().upLoadSuccess(OSSOperUtils.AliYunOSSURLFile + url, type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
if (isViewAttach()) {
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(String headPicture) {
|
||||
// MvpRef.get().showLoadings();
|
||||
// ApiClient.getInstance().updateAvatar(headPicture, new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
// MvpRef.get().updateAvatarSuccess(headPicture);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// MvpRef.get().disLoadings();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNickname() {
|
||||
// TODO: 2019/1/15 完善昵称修改功能
|
||||
api.upUserNickname(new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().updateNicknameSuccess(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSexTrue(String sex) {
|
||||
// TODO: 2019/1/15 完善性别获取头像信息
|
||||
api.upUserPic(sex, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String userPictrue) {
|
||||
MvpRef.get().updateSexTrue(userPictrue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upDateUserInfo(String nickname, String birthday, String sex, String avatar, String init_code, String user_id) {
|
||||
api.userUpdate(nickname, birthday, sex, avatar, init_code, user_id, new BaseObserver<UserBean>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(UserBean userBean) {
|
||||
MvpRef.get().updateSuccess(userBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user