update 粉丝团

This commit is contained in:
2023-08-05 16:52:48 +08:00
parent c8f443c105
commit d912ad6119
20 changed files with 644 additions and 62 deletions

View File

@@ -0,0 +1,81 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class FansGroupGiftPack extends BaseModel{
@SerializedName("id")
private int id;
@SerializedName("quantity")
private int quantity;
@SerializedName("end_time")
private String endTime;
@SerializedName("giftname")
private String giftName;
@SerializedName("needcoin")
private String needCoin;
@SerializedName("gifticon")
private String icon;
public FansGroupGiftPack() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getGiftName() {
return giftName;
}
public void setGiftName(String giftName) {
this.giftName = giftName;
}
public String getNeedCoin() {
return needCoin;
}
public void setNeedCoin(String needCoin) {
this.needCoin = needCoin;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
@Override
public String toString() {
return "FansGroupGiftPack{" +
"id=" + id +
", quantity=" + quantity +
", endTime='" + endTime + '\'' +
", giftName='" + giftName + '\'' +
", needCoin='" + needCoin + '\'' +
", icon='" + icon + '\'' +
'}';
}
}

View File

@@ -0,0 +1,150 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class FansGroupGiftPackInfo extends BaseModel {
@SerializedName("id")
private int id;
@SerializedName("description")
private String description;
@SerializedName("coin")
private String coin;
@SerializedName("data")
private List<Gift> data;
public FansGroupGiftPackInfo() {
}
public int getId() {
return id;
}
public String getCoin() {
return coin;
}
public void setCoin(String coin) {
this.coin = coin;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Gift> getData() {
return data;
}
public void setData(List<Gift> data) {
this.data = data;
}
@Override
public String toString() {
return "FansGroupGiftPack{" +
"id=" + id +
", description='" + description + '\'' +
", coin='" + coin + '\'' +
", data=" + data +
'}';
}
public static class Gift {
@SerializedName("id")
private int id;
@SerializedName("name")
private String giftName;
@SerializedName("needcoin")
private String needCoin;
@SerializedName("src")
private String giftIcon;
@SerializedName("quantity")
private String quantity;
@SerializedName("restrict")
private int restrict;
@SerializedName("type")
private int type;
public Gift() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGiftName() {
return giftName;
}
public void setGiftName(String giftName) {
this.giftName = giftName;
}
public String getNeedCoin() {
return needCoin;
}
public void setNeedCoin(String needCoin) {
this.needCoin = needCoin;
}
public String getGiftIcon() {
return giftIcon;
}
public void setGiftIcon(String giftIcon) {
this.giftIcon = giftIcon;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public int getRestrict() {
return restrict;
}
public void setRestrict(int restrict) {
this.restrict = restrict;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
@Override
public String toString() {
return "Gift{" +
"id=" + id +
", giftName='" + giftName + '\'' +
", needCoin='" + needCoin + '\'' +
", giftIcon='" + giftIcon + '\'' +
", quantity='" + quantity + '\'' +
", restrict='" + restrict + '\'' +
", type=" + type +
'}';
}
}
}

View File

@@ -0,0 +1,39 @@
package com.yunbao.common.dialog;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.CenterPopupView;
/**
* 居中弹窗
*/
public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
public final Context mContext;
public AbsDialogCenterPopupWindow(@NonNull Context context) {
super(context);
this.mContext = context;
}
/**
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
*/
public abstract void buildDialog(XPopup.Builder builder);
public abstract int bindLayoutId();
@Override
protected int getImplLayoutId() {
return bindLayoutId();
}
public void showDialog() {
XPopup.Builder builder = new XPopup.Builder(mContext);
builder.isDestroyOnDismiss(true);
builder.enableDrag(false);
buildDialog(builder);
builder.asCustom(this).show();
}
}

View File

@@ -12,6 +12,8 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
@@ -844,6 +846,7 @@ public interface PDLiveApi {
/**
* 设置系统默认头像
*
* @param id 头像id
*/
@GET("/api/public/?service=Userhome.setAvatar")
@@ -913,6 +916,32 @@ public interface PDLiveApi {
Observable<ResponseModel<MedalAchievementModel>> getUserMedalList(@Query("to_uid") String toUid);
@GET("/api/public/?service=Gift.getLiveMedalList")
Observable<ResponseModel<MedalAchievementModel>> getLiveMedalList( @Query("liveuid") String liveUid);
Observable<ResponseModel<MedalAchievementModel>> getLiveMedalList(@Query("liveuid") String liveUid);
/**
* 获取粉丝团礼物信息
* @param packId 礼包id
*/
@GET("/api/public/?service=Fans.getFansExclusivePack")
Observable<ResponseModel<FansGroupGiftPackInfo>> getFansExclusivePack(@Query("liveuid") String liveUid,
@Query("pack_id") String packId
);
/**
* 购买粉丝团礼包
* @param packId 礼包id
*/
@GET("/api/public/?service=Fans.buyFansExclusivePack")
Observable<ResponseModel<HttpCallbackModel>> buyFansExclusivePack(@Query("liveuid") String liveUid,
@Query("pack_id") String packId,
@Query("stream") String stream
);
/**
* 获取粉丝团礼物包裹
*/
@GET("/api/public/?service=Fans.userFansExclusivePackList")
Observable<ResponseModel<List<FansGroupGiftPack>>> userFansExclusivePackList(@Query("liveuid") String liveUid);
}

View File

@@ -13,6 +13,8 @@ import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
@@ -64,7 +66,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import retrofit2.http.Query;
/**
@@ -1802,6 +1803,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getSystemUserAvatar(HttpCallback<List<UserAvatarSelectBean>> callback) {
API.get().pdLiveApi(mContext)
.getSystemUserAvatar()
@@ -1825,6 +1827,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void setSystemUserAvatar(int id, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.setSystemUserAvatar(id)
@@ -2025,7 +2028,7 @@ public class LiveNetManager {
}).isDisposed();
}
public void getLiveMedalList( String liveUid,HttpCallback<MedalAchievementModel> callback) {
public void getLiveMedalList(String liveUid, HttpCallback<MedalAchievementModel> callback) {
API.get().pdLiveApi(mContext)
.getLiveMedalList(liveUid)
.subscribeOn(Schedulers.io())
@@ -2047,6 +2050,72 @@ public class LiveNetManager {
}).isDisposed();
}
public void getFansExclusivePack(String liveUid, String packId, HttpCallback<FansGroupGiftPackInfo> callback) {
API.get().pdLiveApi(mContext)
.getFansExclusivePack(liveUid, packId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<FansGroupGiftPackInfo>>() {
@Override
public void accept(ResponseModel<FansGroupGiftPackInfo> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void buyFansExclusivePack(String liveUid, String packId,String stream, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.buyFansExclusivePack(liveUid, packId,stream)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<HttpCallbackModel>>() {
@Override
public void accept(ResponseModel<HttpCallbackModel> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void userFansExclusivePackList(String liveUid, HttpCallback<List<FansGroupGiftPack>> callback) {
API.get().pdLiveApi(mContext)
.userFansExclusivePackList(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<FansGroupGiftPack>>>() {
@Override
public void accept(ResponseModel<List<FansGroupGiftPack>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/**
* 直播间取消网络请求
*/