展示红包,领取红包接口逻辑对接
This commit is contained in:
@@ -41,11 +41,15 @@ public class RedPacketInfoModel extends BaseModel {
|
||||
private String userExists;
|
||||
@SerializedName("is_attention")
|
||||
private String isAttention;
|
||||
//0.未领取到 1.领取但是没抢过东西 2.已经领抢到东西
|
||||
@SerializedName("receive_status")
|
||||
private String receiveStatus;
|
||||
|
||||
public String getIsAttention() {
|
||||
return isAttention;
|
||||
}
|
||||
|
||||
|
||||
public RedPacketInfoModel setIsAttention(String isAttention) {
|
||||
this.isAttention = isAttention;
|
||||
return this;
|
||||
@@ -56,6 +60,26 @@ public class RedPacketInfoModel extends BaseModel {
|
||||
|
||||
@SerializedName("red_packet_gift")
|
||||
private List<RedPacketGiftModel> packetGiftModels;
|
||||
@SerializedName("gift")
|
||||
private List<RedPacketGiftModel> giftModels;
|
||||
|
||||
public String getReceiveStatus() {
|
||||
return receiveStatus;
|
||||
}
|
||||
|
||||
public RedPacketInfoModel setReceiveStatus(String receiveStatus) {
|
||||
this.receiveStatus = receiveStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<RedPacketGiftModel> getGiftModels() {
|
||||
return giftModels;
|
||||
}
|
||||
|
||||
public RedPacketInfoModel setGiftModels(List<RedPacketGiftModel> giftModels) {
|
||||
this.giftModels = giftModels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<RedPacketGiftModel> getPacketGiftModels() {
|
||||
return packetGiftModels;
|
||||
|
||||
@@ -751,4 +751,16 @@ public interface PDLiveApi {
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("red_packet_id") String redPacketId
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物当前数据
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getRedPacket")
|
||||
Observable<ResponseModel<RedPacketInfoModel>> getRedPacket(
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("stream") String stream,
|
||||
@Query("red_packet_id") String redPacketId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1603,6 +1603,28 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取红包
|
||||
*
|
||||
* @param liveUid 直播间id
|
||||
* @param redPacketId 红包id
|
||||
*/
|
||||
public void getRedPacket(String liveUid,String stream, String redPacketId, HttpCallback<RedPacketInfoModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRedPacket(liveUid, stream,redPacketId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(redPacketInfoModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(redPacketInfoModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -1226,4 +1226,6 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="red_packet_countdown">倒計時:%s</string>
|
||||
<string name="open_red_packet">待開紅包:%s</string>
|
||||
<string name="together_to_achieve_goal">來自%s的獎勵,齊心協力連成目標</string>
|
||||
<string name="red_too_bad">很遺憾</string>
|
||||
<string name="red_too_bad2">與紅包擦肩而過</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user