心动空间
This commit is contained in:
102
BaseModule/src/main/java/com/xscm/moduleutil/bean/HeartCpBean.kt
Normal file
102
BaseModule/src/main/java/com/xscm/moduleutil/bean/HeartCpBean.kt
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
class HeartCpBean : Serializable {
|
||||
|
||||
|
||||
/* {
|
||||
"code": 1,
|
||||
"msg": "\u6210\u529f",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id1": 20001,
|
||||
"user_id2": 20003,
|
||||
"status": 1,
|
||||
"level": 1,
|
||||
"exp": 9198,
|
||||
"createtime": 1763720783,
|
||||
"user_info1": {
|
||||
"user_id": 20001,
|
||||
"nickname": "\u9ad8\u5174\u7684\u5c0f\u6d77\u817e",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/ios_images\/1761615690733.jpeg"
|
||||
},
|
||||
"user_info2": {
|
||||
"user_id": 20003,
|
||||
"nickname": "\u79c0\u4e3d\u7684\u978b\u57ab",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/android_images\/33e31b18577856c4f10906b7cabaa698.jpg"
|
||||
},
|
||||
"next_level_exp": 802,
|
||||
"pendant": "https:\/\/cos.xscmmidi.site\/admin\/520liuxingyu_17637096968287.mp4",
|
||||
"gift_log": [
|
||||
{
|
||||
"id": 323,
|
||||
"room_id": 6003,
|
||||
"from_user_id": 20001,
|
||||
"to_user_id": 20003,
|
||||
"gift_id": 313,
|
||||
"num": 1,
|
||||
"cp_zone_id": 1,
|
||||
"exp": "1314",
|
||||
"exp_total": "9198",
|
||||
"remark": "\u9001\u7ed9\u79c0\u4e3d\u7684\u978b\u57ab1\u4e2a\u9e4a\u7f18\u7ec7\u68a6,\u83b7\u5f971314\u7ecf\u9a8c\u503c\uff0c\u603b\u7ecf\u9a8c\u503c\u589e\u52a0\u81f39198",
|
||||
"createtime": 1763796118,
|
||||
"gift_name": "\u9e4a\u7f18\u7ec7\u68a6",
|
||||
"from_user_info": {
|
||||
"user_id": 20001,
|
||||
"nickname": "\u9ad8\u5174\u7684\u5c0f\u6d77\u817e",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/ios_images\/1761615690733.jpeg"
|
||||
},
|
||||
"to_user_info": {
|
||||
"user_id": 20003,
|
||||
"nickname": "\u79c0\u4e3d\u7684\u978b\u57ab",
|
||||
"avatar": "https:\/\/yusheng-1369267578.cos.ap-guangzhou.myqcloud.com\/images\/android_images\/33e31b18577856c4f10906b7cabaa698.jpg"
|
||||
}
|
||||
}]
|
||||
},
|
||||
"api_version": ""
|
||||
}*/
|
||||
|
||||
var id: Int = 0
|
||||
var user_id1: Int = 0
|
||||
var user_id2: Int = 0
|
||||
var status: Int = 0
|
||||
var level: Int = 0
|
||||
var exp: Long = 0
|
||||
var createtime: Long = 0
|
||||
var user_info1: UserInfo = UserInfo()
|
||||
var user_info2: UserInfo = UserInfo()
|
||||
var next_level_exp: Long = 0
|
||||
var pendant: String = ""
|
||||
var gift_log: List<GiftLog> = ArrayList()
|
||||
var api_version: String = ""
|
||||
|
||||
class GiftLog : Serializable {
|
||||
var id: Int = 0
|
||||
var room_id: Int = 0
|
||||
var from_user_id: Int = 0
|
||||
var to_user_id: Int = 0
|
||||
var gift_id: Int = 0
|
||||
var num: Int = 0
|
||||
var cp_zone_id: Int = 0
|
||||
var exp: String = ""
|
||||
var exp_total: String = ""
|
||||
var remark: String = ""
|
||||
var createtime: Long = 0
|
||||
var gift_name: String = ""
|
||||
var from_user_info: UserInfo = UserInfo()
|
||||
var to_user_info: UserInfo = UserInfo()
|
||||
|
||||
class UserInfo : Serializable {
|
||||
var user_id: Int = 0
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
class UserInfo : Serializable {
|
||||
var user_id: Int = 0
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
}
|
||||
}
|
||||
@@ -856,4 +856,7 @@ public interface ApiServer {
|
||||
@POST(Constants.ROOM_USER_RECONNECT)
|
||||
Call<BaseModel<String>> roomUserReconnect(@Field("room_id") String room_id);
|
||||
|
||||
@GET(Constants.GET_CP_ZONE)
|
||||
Call<BaseModel<HeartCpBean>> getCpRoom(@Query("user_id") String userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -141,7 +141,9 @@ public class RetrofitClient {
|
||||
mRetrofit = provideRetrofit(provideOkHttpClient());
|
||||
sApiServer = mRetrofit.create(ApiServer.class);
|
||||
}
|
||||
|
||||
private CPListener cpListener;
|
||||
|
||||
public void CpListener(CPListener cpListenter) {
|
||||
this.cpListener = cpListenter;
|
||||
}
|
||||
@@ -604,7 +606,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void singerSongCut(String id,BaseObserver<String> observer) {
|
||||
public void singerSongCut(String id, BaseObserver<String> observer) {
|
||||
sApiServer.singerSongCut(id).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
@@ -632,7 +634,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void singerSongTop(String id,BaseObserver<String> observer){
|
||||
public void singerSongTop(String id, BaseObserver<String> observer) {
|
||||
sApiServer.singerSongTop(id).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
@@ -662,8 +664,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void singerSongCount(String roomId,BaseObserver<SingerSongCount> observer){
|
||||
sApiServer.singerSongCount(roomId).enqueue(new Callback<BaseModel<SingerSongCount>>(){
|
||||
public void singerSongCount(String roomId, BaseObserver<SingerSongCount> observer) {
|
||||
sApiServer.singerSongCount(roomId).enqueue(new Callback<BaseModel<SingerSongCount>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<SingerSongCount>> call, Response<BaseModel<SingerSongCount>> response) {
|
||||
@@ -678,7 +680,7 @@ public class RetrofitClient {
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
@@ -3094,19 +3096,19 @@ public class RetrofitClient {
|
||||
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomGiftData>> call, Response<BaseModel<RoomGiftData>> response) {
|
||||
if (response.code()==200){
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RoomGiftData> data = response.body();
|
||||
if (data.getCode()==1) {
|
||||
if (data.getData().getCp_type()!=null){
|
||||
if (cpListener !=null){
|
||||
if (data.getCode() == 1) {
|
||||
if (data.getData().getCp_type() != null) {
|
||||
if (cpListener != null) {
|
||||
cpListener.onSendCpMsg(data.getData());
|
||||
}
|
||||
}
|
||||
observer.onNext(data.getData());
|
||||
|
||||
}else if (data.getCode()==0){
|
||||
} else if (data.getCode() == 0) {
|
||||
ToastUtils.showShort(data.getMsg());
|
||||
}else if (data.getCode()==301) {
|
||||
} else if (data.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(data.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
@@ -3124,24 +3126,24 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void cpGiveGift(String user_id, String gift_id,String room_id,BaseObserver<RoomGiftData> observer) {
|
||||
sApiServer.cpGiveGift(user_id, gift_id,room_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
|
||||
public void cpGiveGift(String user_id, String gift_id, String room_id, BaseObserver<RoomGiftData> observer) {
|
||||
sApiServer.cpGiveGift(user_id, gift_id, room_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomGiftData>> call, Response<BaseModel<RoomGiftData>> response) {
|
||||
if (response.code()==200){
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RoomGiftData> data = response.body();
|
||||
if (data.getCode()==1) {
|
||||
if (data.getData().getCp_type()!=null){
|
||||
if (cpListener !=null){
|
||||
if (data.getCode() == 1) {
|
||||
if (data.getData().getCp_type() != null) {
|
||||
if (cpListener != null) {
|
||||
cpListener.onSendCpMsg(data.getData());
|
||||
}
|
||||
}
|
||||
observer.onNext(data.getData());
|
||||
|
||||
}else if (data.getCode()==0){
|
||||
} else if (data.getCode() == 0) {
|
||||
ToastUtils.showShort(data.getMsg());
|
||||
}else if (data.getCode()==301) {
|
||||
} else if (data.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(data.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
@@ -3154,7 +3156,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RoomGiftData>> call, Throwable t) {
|
||||
LogUtils.e("cpGiveGift",t.fillInStackTrace());
|
||||
LogUtils.e("cpGiveGift", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3403,7 +3405,6 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void agreeSong(String room_id, String type, BaseObserver<String> observer) {
|
||||
sApiServer.agreeSong(room_id, type).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
@@ -3623,23 +3624,23 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getFriendListMore(String user_id,String relation_id,BaseObserver<List<RelationshipBean>> observer){
|
||||
sApiServer.getFriendListMore(user_id,relation_id).enqueue(new Callback<BaseModel<List<RelationshipBean>>>() {
|
||||
public void getFriendListMore(String user_id, String relation_id, BaseObserver<List<RelationshipBean>> observer) {
|
||||
sApiServer.getFriendListMore(user_id, relation_id).enqueue(new Callback<BaseModel<List<RelationshipBean>>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RelationshipBean>>> call, Response<BaseModel<List<RelationshipBean>>> response) {
|
||||
if (response.code()==200){
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<RelationshipBean>> baseModel = response.body();
|
||||
if (baseModel.getCode()==1) {
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData());
|
||||
}else if (baseModel.getCode()==301){
|
||||
} else if (baseModel.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
@@ -3647,7 +3648,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<RelationshipBean>>> call, Throwable t) {
|
||||
LogUtils.e("getFriendListMore",t.toString());
|
||||
LogUtils.e("getFriendListMore", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3783,22 +3784,22 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getFriendList(String userId,String page,String page_limit,BaseObserver<RelationBean> observer) {
|
||||
public void getFriendList(String userId, String page, String page_limit, BaseObserver<RelationBean> observer) {
|
||||
sApiServer.getFriendList(userId, page, page_limit).enqueue(new Callback<BaseModel<RelationBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RelationBean>> call, Response<BaseModel<RelationBean>> response) {
|
||||
if (response.code()==200){
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RelationBean> body = response.body();
|
||||
if (body.getCode()==1){
|
||||
if (body.getCode() == 1) {
|
||||
observer.onNext(body.getData());
|
||||
}else if (body.getCode()==301){
|
||||
} else if (body.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(body.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showShort(body.getMsg());
|
||||
}
|
||||
}
|
||||
@@ -3806,7 +3807,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RelationBean>> call, Throwable t) {
|
||||
LogUtils.e("getFriendList",t.fillInStackTrace());
|
||||
LogUtils.e("getFriendList", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -4555,4 +4556,27 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getCpRoom(String userId,BaseObserver<HeartCpBean> observer) {
|
||||
sApiServer.getCpRoom(userId).enqueue(new Callback<BaseModel<HeartCpBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<HeartCpBean>> call, Response<BaseModel<HeartCpBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<HeartCpBean> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData());
|
||||
} else if (baseModel.getCode() == 0) {
|
||||
observer.onNext(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<HeartCpBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ public abstract class BasePresenter<V extends IView> implements IPresenter {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public BasePresenter() {
|
||||
|
||||
}
|
||||
|
||||
private void attachView(V view) {
|
||||
MvpRef = new WeakReference<V>(view);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class TimeUtils {
|
||||
}
|
||||
public static String getDateToStringNoZ(long time) {
|
||||
Date d = new Date(time);
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return sf.format(d);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public class TimeUtils {
|
||||
}
|
||||
|
||||
// 如果天数不足1天,根据需求可以返回空字符串,也可以返回 "0天" 或其他
|
||||
return ""; // 或者 return "0天";
|
||||
return "1天"; // 或者 return "0天";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -279,6 +279,7 @@ public class Constants {
|
||||
|
||||
public static final String GET_ROOM_GIFT = "/api/Room/room_give_gift";//直播间送礼
|
||||
public static final String POST_CP_GIVE_GIFT = "/api/UserCp/cpGiveGift";//用户CP礼物回赠
|
||||
public static final String GET_CP_ZONE = "/api/UserCp/cpZone";//心动空间
|
||||
public static final String GET_ROOM_USER = "/api/Room/room_user_home";//房间内点击头像
|
||||
public static final String APPLY_PIT = "/api/RoomPit/apply_pit";//申请上麦
|
||||
public static final String DOWN_PIT = "/api/RoomPit/down_pit";//下麦
|
||||
|
||||
Reference in New Issue
Block a user