全服红包开关,完善个人信息流程,删除无用资源图
This commit is contained in:
@@ -5,10 +5,9 @@ import androidx.annotation.Nullable;
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.GiftAchievementInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.NewUserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.GiftWallInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.NewUserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserGameInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
|
@@ -132,26 +132,27 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
@SuppressLint("CheckResult")
|
||||
private void onLogin(final long uid) {
|
||||
api.requestUserInfo(String.valueOf(uid))
|
||||
.flatMap(userResult -> {
|
||||
UserInfo userInfo = userResult.getData();
|
||||
ThirdUserInfo thirdUserInfo = AuthModel.get().getThirdUserInfo();
|
||||
if ((TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) && thirdUserInfo != null) {
|
||||
if (thirdUserInfo.getType() == ThirdUserInfo.TYPE_WX || thirdUserInfo.getType() == ThirdUserInfo.TYPE_QQ) {
|
||||
String avatarUrlWX = thirdUserInfo.getUserIcon();
|
||||
String nick = thirdUserInfo.getUserName();
|
||||
String str_gender = thirdUserInfo.getUserGender() == null ? "" : thirdUserInfo.getUserGender();
|
||||
int gender = str_gender.equals("m") ? UserInfo.GENDER_MALE : UserInfo.GENDER_FEMALE;
|
||||
return api.updateUserInfo(AuthModel.get().getTicket(), uid, nick, avatarUrlWX, gender)
|
||||
.map(userInfoServiceResult -> {
|
||||
if (userInfoServiceResult.isSuccess()) {
|
||||
return userInfoServiceResult;
|
||||
}
|
||||
return userResult;
|
||||
});
|
||||
}
|
||||
}
|
||||
return Single.just(userResult);
|
||||
})
|
||||
//第三方登录成功直接跳转首页
|
||||
// .flatMap(userResult -> {
|
||||
// UserInfo userInfo = userResult.getData();
|
||||
// ThirdUserInfo thirdUserInfo = AuthModel.get().getThirdUserInfo();
|
||||
// if ((TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) && thirdUserInfo != null) {
|
||||
// if (thirdUserInfo.getType() == ThirdUserInfo.TYPE_WX || thirdUserInfo.getType() == ThirdUserInfo.TYPE_QQ) {
|
||||
// String avatarUrlWX = thirdUserInfo.getUserIcon();
|
||||
// String nick = thirdUserInfo.getUserName();
|
||||
// String str_gender = thirdUserInfo.getUserGender() == null ? "" : thirdUserInfo.getUserGender();
|
||||
// int gender = str_gender.equals("m") ? UserInfo.GENDER_MALE : UserInfo.GENDER_FEMALE;
|
||||
// return api.updateUserInfo(AuthModel.get().getTicket(), uid, nick, avatarUrlWX, gender)
|
||||
// .map(userInfoServiceResult -> {
|
||||
// if (userInfoServiceResult.isSuccess()) {
|
||||
// return userInfoServiceResult;
|
||||
// }
|
||||
// return userResult;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// return Single.just(userResult);
|
||||
// })
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.flatMap(userResult -> {
|
||||
if (userResult == null || !userResult.isSuccess() || userResult.getData() == null) {
|
||||
@@ -368,7 +369,7 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
* @param roomUid
|
||||
*/
|
||||
@Override
|
||||
public Single<UserInfo> requestCompleteUserInfo(final UserInfo userInfo, String shareChannel, String shareUid, String roomUid, String shareCode) {
|
||||
public Single<UserInfo> requestCompleteUserInfo(final UserInfo userInfo, String shareChannel, String shareUid, String roomUid, String inviteCode) {
|
||||
|
||||
if (StringUtils.isEmpty(String.valueOf(userInfo.getUid()))) {
|
||||
return Single.error(new Throwable("用户uid为空"));
|
||||
@@ -402,8 +403,8 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
if (StringUtils.isEmpty(roomUid) || !isNumeric(roomUid)) {
|
||||
roomUid = null;
|
||||
}
|
||||
if (TextUtils.isEmpty(shareCode)) {
|
||||
shareCode = null;
|
||||
if (TextUtils.isEmpty(inviteCode)) {
|
||||
inviteCode = null;
|
||||
}
|
||||
|
||||
return api.updateUserInfo(
|
||||
@@ -421,7 +422,8 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
shareCode
|
||||
null,
|
||||
inviteCode
|
||||
)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
@@ -510,6 +512,7 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
voiceDura,
|
||||
region,
|
||||
userDesc,
|
||||
null,
|
||||
null
|
||||
)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
@@ -854,7 +857,8 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
@Field("voiceDura") String voiceDura,
|
||||
@Field("region") String region,
|
||||
@Field("userDesc") String userDesc,
|
||||
@Field("inviteCode") String shareCode);
|
||||
@Field("shareCode") String shareCode,
|
||||
@Field("inviteCode") String inviteCode);
|
||||
|
||||
/**
|
||||
* @param ticket
|
||||
|
Reference in New Issue
Block a user