parent
7d24add9fe
commit
9946124b15
@ -0,0 +1,50 @@ |
||||
package com.unionmed.unionmedtv.utils; |
||||
|
||||
import android.content.Context; |
||||
import android.text.TextUtils; |
||||
import android.widget.ImageView; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.lifecycle.LifecycleOwner; |
||||
|
||||
import com.blankj.utilcode.util.LogUtils; |
||||
import com.blankj.utilcode.util.StringUtils; |
||||
import com.blankj.utilcode.util.ToastUtils; |
||||
import com.bumptech.glide.Glide; |
||||
import com.bumptech.glide.request.RequestOptions; |
||||
import com.google.gson.Gson; |
||||
import com.hjq.http.EasyHttp; |
||||
import com.hjq.http.listener.OnHttpListener; |
||||
import com.tencent.mmkv.MMKV; |
||||
import com.unionmed.unionmedtv.R; |
||||
import com.unionmed.unionmedtv.api.GetImUserInfoApi; |
||||
import com.unionmed.unionmedtv.bean.City; |
||||
import com.unionmed.unionmedtv.bean.ImUserInfoBean; |
||||
import com.unionmed.unionmedtv.bean.TokenBean; |
||||
import com.unionmed.unionmedtv.network.ApiResponse; |
||||
import com.unionmed.unionmedtv.network.HttpData; |
||||
|
||||
import io.rong.imlib.model.Message; |
||||
|
||||
public class UserInfoByServerUtil { |
||||
//获取用户信息
|
||||
public static void getUserInfoByServer(Context context,String senderUserId, UserInfoInterface userInfoInterface) { |
||||
EasyHttp.post((LifecycleOwner) context) |
||||
.api(new GetImUserInfoApi(CacheUtil.getToken().getToken(), senderUserId)) |
||||
.request(new OnHttpListener<HttpData<ApiResponse<ImUserInfoBean>>>() { |
||||
@Override |
||||
public void onHttpSuccess(HttpData<ApiResponse<ImUserInfoBean>> result) { |
||||
userInfoInterface.success(result); |
||||
} |
||||
|
||||
@Override |
||||
public void onHttpFail(Exception e) { |
||||
userInfoInterface.Fail(e.getMessage()); |
||||
} |
||||
}); |
||||
} |
||||
public interface UserInfoInterface{ |
||||
void success(HttpData<ApiResponse<ImUserInfoBean>> result); |
||||
void Fail(String E); |
||||
} |
||||
} |
Loading…
Reference in new issue