Merge branch 'change_live'
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 新用户等级牌
|
||||
*/
|
||||
public class NewLevelModel extends BaseModel {
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("levemin")
|
||||
private String levemin;
|
||||
@SerializedName("levemax")
|
||||
private String levemax;
|
||||
@SerializedName("thumb")
|
||||
private String thumb;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public NewLevelModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemin() {
|
||||
return levemin;
|
||||
}
|
||||
|
||||
public int getLeveMin() {
|
||||
return Integer.parseInt(levemin);
|
||||
}
|
||||
|
||||
public int getLeveMax() {
|
||||
return Integer.parseInt(levemax);
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemin(String levemin) {
|
||||
this.levemin = levemin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemax() {
|
||||
return levemax;
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemax(String levemax) {
|
||||
this.levemax = levemax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public NewLevelModel setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
@@ -18,6 +19,7 @@ import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
@@ -190,6 +192,10 @@ public class CommonHttpUtil {
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
|
||||
@@ -7,8 +7,10 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.cosmos.baseutil.app.AppContext;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -25,18 +27,18 @@ import org.greenrobot.eventbus.EventBus;
|
||||
* 登录者信息管理
|
||||
*/
|
||||
public class IMLoginManager extends BaseCacheManager {
|
||||
private final static String KEY_USER_INFO = "keyUserInfo";
|
||||
private final String KEY_USER_INFO = "keyUserInfo";
|
||||
private static IMLoginManager manager;
|
||||
private IMLoginModel userInfo;
|
||||
private final static String isNewUserGif = "isNewUserGif";
|
||||
private final static String isNewUserOne = "isNewUserOne";
|
||||
private final static String GiftEffect = "giftEffect";
|
||||
private final static String MountEffect = "mountEffect";
|
||||
private final static String IS_CHAT = "isChat";
|
||||
private final static String IS_SLIDE = "isSlide";
|
||||
private final static String IS_FLOAT = "is_float";
|
||||
private final static String IS_HINT = "is_hint";
|
||||
private final static String IS_HINT2 = "is_hint2";
|
||||
private final String isNewUserGif = "isNewUserGif";
|
||||
private final String isNewUserOne = "isNewUserOne";
|
||||
private final String GiftEffect = "giftEffect";
|
||||
private final String MountEffect = "mountEffect";
|
||||
private final String IS_CHAT = "isChat";
|
||||
private final String IS_SLIDE = "isSlide";
|
||||
private final String IS_FLOAT = "is_float";
|
||||
private final String IS_HINT = "is_hint";
|
||||
private final String IS_HINT2 = "is_hint2";
|
||||
|
||||
|
||||
public boolean isHint() {
|
||||
@@ -151,7 +153,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
*/
|
||||
public static IMLoginManager get(Context context) {
|
||||
if (null == manager) {
|
||||
manager = new IMLoginManager(context);
|
||||
manager = new IMLoginManager(CommonAppContext.sInstance.getBaseContext());
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新粉丝牌管理
|
||||
*/
|
||||
public class NewLevelManager extends BaseCacheManager {
|
||||
private final String KEY_USER_LEVEL = "keyUserLevel";
|
||||
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
||||
|
||||
public NewLevelManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
public void UpDataLevel(String json) {
|
||||
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
put(KEY_USER_LEVEL, newLevelModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<NewLevelModel> getNewLevelModels() {
|
||||
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user