6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-08 09:34:15 +08:00
parent 3ab91a74d1
commit 994bd2a3aa
3 changed files with 76 additions and 20 deletions

View File

@ -863,6 +863,15 @@ public interface PDLiveApi {
@Query("to_uid") String toUid @Query("to_uid") String toUid
); );
/**
* 礼物墙已点亮
*/
@GET("/api/public/?service=Gift.giftUserSendWall")
Observable<ResponseModel<GiftAlreadyWallModel>> giftUserSendWall(
@Query("liveuid") String liveUid,
@Query("to_uid") String toUid
);
/** /**
* 礼物墙未点亮 * 礼物墙未点亮
*/ */

View File

@ -1874,6 +1874,28 @@ public class LiveNetManager {
}).isDisposed(); }).isDisposed();
} }
public void giftUserSendWall(String liveUid, String toUid, HttpCallback<GiftAlreadyWallModel> callback) {
API.get().pdLiveApi(mContext)
.giftUserSendWall(liveUid, toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GiftAlreadyWallModel>>() {
@Override
public void accept(ResponseModel<GiftAlreadyWallModel> giftAlreadyWallModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(giftAlreadyWallModelResponseModel.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 giftWithoutWall(String liveUid, String toUid, HttpCallback<GiftAlreadyWallModel> callback) { public void giftWithoutWall(String liveUid, String toUid, HttpCallback<GiftAlreadyWallModel> callback) {
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)
.giftWithoutWall(liveUid, toUid) .giftWithoutWall(liveUid, toUid)
@ -2072,9 +2094,9 @@ public class LiveNetManager {
}).isDisposed(); }).isDisposed();
} }
public void buyFansExclusivePack(String liveUid, String packId,String stream, HttpCallback<HttpCallbackModel> callback) { public void buyFansExclusivePack(String liveUid, String packId, String stream, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)
.buyFansExclusivePack(liveUid, packId,stream) .buyFansExclusivePack(liveUid, packId, stream)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<HttpCallbackModel>>() { .subscribe(new Consumer<ResponseModel<HttpCallbackModel>>() {

View File

@ -82,27 +82,52 @@ public class GiftAlreadyWallFragment extends BaseFragment {
@Override @Override
protected void loadData() { protected void loadData() {
LiveNetManager.get(getActivity()). if (isAnchor){
giftAlreadyWall(mLiveUid, toUid, new HttpCallback<GiftAlreadyWallModel>() { LiveNetManager.get(getActivity()).
@Override giftAlreadyWall(mLiveUid, toUid, new HttpCallback<GiftAlreadyWallModel>() {
public void onSuccess(GiftAlreadyWallModel data) { @Override
if (data.getGiftWall().size() > 0) { public void onSuccess(GiftAlreadyWallModel data) {
giftWallNoData.setVisibility(View.GONE); if (data.getGiftWall().size() > 0) {
giftWallData.setVisibility(View.VISIBLE); giftWallNoData.setVisibility(View.GONE);
alreadyWallAdapter.addAllData(data.getGiftWall()); giftWallData.setVisibility(View.VISIBLE);
litIcon.setText(data.getGiftWallLightenNumber()); alreadyWallAdapter.addAllData(data.getGiftWall());
giftAll.setText("/" + data.getGiftWallLightenTotal()); litIcon.setText(data.getGiftWallLightenNumber());
} else { giftAll.setText("/" + data.getGiftWallLightenTotal());
giftWallNoData.setVisibility(View.VISIBLE); } else {
giftWallData.setVisibility(View.GONE); giftWallNoData.setVisibility(View.VISIBLE);
giftWallData.setVisibility(View.GONE);
}
} }
}
@Override @Override
public void onError(String error) { public void onError(String error) {
}
});
}else {
LiveNetManager.get(getActivity()).
giftUserSendWall(mLiveUid, toUid, new HttpCallback<GiftAlreadyWallModel>() {
@Override
public void onSuccess(GiftAlreadyWallModel data) {
if (data.getGiftWall().size() > 0) {
giftWallNoData.setVisibility(View.GONE);
giftWallData.setVisibility(View.VISIBLE);
alreadyWallAdapter.addAllData(data.getGiftWall());
litIcon.setText(data.getGiftWallLightenNumber());
giftAll.setText("/" + data.getGiftWallLightenTotal());
} else {
giftWallNoData.setVisibility(View.VISIBLE);
giftWallData.setVisibility(View.GONE);
}
}
@Override
public void onError(String error) {
}
});
}
}
});
} }
public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid, String toUid, boolean isAnchor) { public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid, String toUid, boolean isAnchor) {