feat:恢复转赠功能
This commit is contained in:
@@ -8,6 +8,8 @@ import com.chwl.core.community.CommunityConstant
|
||||
import com.chwl.core.community.bean.UnReadCountInfo
|
||||
import com.chwl.core.home.bean.*
|
||||
import com.chwl.core.room.bean.AnchorInfo
|
||||
import com.chwl.core.user.bean.DiamondGiveHistoryInfo
|
||||
import com.chwl.core.user.bean.SearchUserInfo
|
||||
import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.core.utils.net.launchRequest
|
||||
@@ -183,7 +185,79 @@ object HomeModel : BaseModel() {
|
||||
api.getResourceJumpInfo(id)
|
||||
}
|
||||
|
||||
suspend fun getDiamondGiveHistory(page: Int, pageSize: Int): List<DiamondGiveHistoryInfo>? =
|
||||
launchRequest {
|
||||
api.getRecord(page, pageSize)
|
||||
}
|
||||
|
||||
suspend fun getSearchUser(erbanNo: Long): SearchUserInfo? =
|
||||
launchRequest {
|
||||
api.getSearchUser(erbanNo)
|
||||
}
|
||||
|
||||
suspend fun giveGift(toUid: Long, giftId: Int, giftNum: Int): String? =
|
||||
launchRequest {
|
||||
api.giveGift(toUid, giftId, giftNum)
|
||||
}
|
||||
|
||||
suspend fun getGiveDetail(
|
||||
uid: Long,
|
||||
type: Int,
|
||||
page: Int,
|
||||
pageSize: Int
|
||||
): List<DiamondGiveHistoryInfo>? =
|
||||
launchRequest {
|
||||
api.getGiveDetail(uid, type, page, pageSize)
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
* 轉贈鉆石歷史記錄
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/user/diamond/giveRecord")
|
||||
suspend fun getRecord(
|
||||
@Query("pageNum") pageNum: Int?,
|
||||
@Query("pageSize") pageSize: Int?
|
||||
): ServiceResult<List<DiamondGiveHistoryInfo>>
|
||||
|
||||
/**
|
||||
* 精確搜索用戶
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST("/user/diamond/searchUser")
|
||||
suspend fun getSearchUser(
|
||||
@Query("erbanNo") erbanNo: Long?
|
||||
): ServiceResult<SearchUserInfo>
|
||||
|
||||
/**
|
||||
* 贈送禮物
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST("/user/diamond/giveGift")
|
||||
suspend fun giveGift(
|
||||
@Query("toUid") toUid: Long?,
|
||||
@Query("giftId") giftId: Int?,
|
||||
@Query("giftNum") giftNum: Int?
|
||||
): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* 轉贈詳情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/user/diamond/giveRecordVoByType")
|
||||
suspend fun getGiveDetail(
|
||||
@Query("toUid") toUid: Long?,
|
||||
@Query("type") type: Int?,
|
||||
@Query("pageNum") pageNum: Int?,
|
||||
@Query("pageSize") pageSize: Int?
|
||||
): ServiceResult<List<DiamondGiveHistoryInfo>>
|
||||
|
||||
/**
|
||||
* 提交反馈
|
||||
*
|
||||
|
@@ -217,4 +217,8 @@ public class RouterType {
|
||||
* 用户等级(目前只是本地用到,所以用了100001)
|
||||
*/
|
||||
public static final int USER_LEVEL = 100001;
|
||||
/**
|
||||
* 我的转赠(目前只是本地用到,所以用了100002)
|
||||
*/
|
||||
public static final int USER_DONATION = 100002;
|
||||
}
|
||||
|
@@ -86,4 +86,5 @@ public interface IPayModel extends IModel {
|
||||
|
||||
Single<String> getChargeContact();
|
||||
|
||||
Single<String> giveGold(long toUid, String goldNum, String password);
|
||||
}
|
||||
|
@@ -325,8 +325,27 @@ public class PayModel extends BaseModel implements IPayModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Single<String> giveGold(long toUid, String goldNum, String password) {
|
||||
return api.giveGold(toUid, goldNum, password)
|
||||
.compose(RxHelper.handleStringData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
public interface Api {
|
||||
|
||||
/**
|
||||
* 钻石转赠
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/diamond/give")
|
||||
Single<ServiceResult<String>> giveGold(@Field("toUid") long toUid,
|
||||
@Field("diamondNum") String diamondNum,
|
||||
@Field("payPwd") String payPwd);
|
||||
|
||||
/**
|
||||
* 获取钱包
|
||||
*
|
||||
|
Reference in New Issue
Block a user