Commit 646724d8 authored by mengcuiguang's avatar mengcuiguang

账号合并优化

parent 9eb48dbe
......@@ -38,7 +38,7 @@ public class AccountMsgBean implements Serializable {
this.wxUser = wxUser;
}
public static class MobileUserBean implements Serializable {
public class MobileUserBean implements Serializable {
/**
* head : null
* contribution : 0
......@@ -94,7 +94,7 @@ public class AccountMsgBean implements Serializable {
}
}
public static class WxUserBean implements Serializable {
public class WxUserBean implements Serializable {
/**
* head : https://thirdwx.qlogo.cn/mmopen/vi_32/zo9QSE4Hgv2M2zGLTyTHyyaM6SKxKkIeJJhU0nxNZxXGAQV0SnBKwqfXkspujZjI23tvgWBJMqlziaq5Cw7r0vg/132
* contribution : 0
......
......@@ -2,8 +2,10 @@ package com.mints.goodmoney.mvp.presenters
import com.google.gson.JsonObject
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.AccountMsgBean
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.views.AccountMergeView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
......@@ -51,19 +53,20 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
vo["saveType"] = saveType
AppHttpManager.getInstance(loanApplication)
.call(loanService.toKeepAccount(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
override fun onNext(baseResponse: BaseResponse<UserBean>) {
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.toKeepAccountSuc(saveType)
200 -> if (baseResponse.data != null) {
UserManager.getInstance().saveUserInfo(baseResponse.data)
view.toKeepAccountSuc()
}
else -> {
view.showToast(message)
......
......@@ -7,7 +7,7 @@ interface AccountMergeView : BaseView {
fun getKeepAccountMsgSuc(data: AccountMsgBean)
fun getKeepAccountMsgFail()
fun toKeepAccountSuc(saveType: Int)
fun toKeepAccountSuc()
fun toKeepAccountFail()
}
\ No newline at end of file
......@@ -426,7 +426,7 @@ public interface LoanService {
* @return
*/
@POST("api/toKeepAccount")
Observable<BaseResponse<Object>> toKeepAccount(@Body Map<String, Object> vo);
Observable<BaseResponse<UserBean>> toKeepAccount(@Body Map<String, Object> vo);
/**
......
......@@ -138,7 +138,7 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
override fun getKeepAccountMsgFail() {}
override fun toKeepAccountSuc(saveType: Int) {
override fun toKeepAccountSuc() {
showToast("账号合并成功!")
......
......@@ -113,8 +113,6 @@ class BindWxDialog(context: Activity) :
bundle.putString(Constant.MERGE_WXOPENID, wxOpenId)
bundle.putString(Constant.MERGE_KEY, key)
readyGo(AccountMergeActivity::class.java, bundle)
dismiss()
}
protected fun readyGo(clazz: Class<*>?, bundle: Bundle?) {
......
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