兑换和提现功能开发
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.yizhuan.xchat_android_core.earn.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
data class ConfigWithdrawInfo(
|
||||
val account: WithdrawAccount,
|
||||
val golds: Double,//钱包当前金币数
|
||||
val remainTimes: Int,//周剩余次数
|
||||
val fee: Double,//手续费
|
||||
val minGolds: Long,
|
||||
val maxGolds: Long,
|
||||
val hasPayPwd: Boolean
|
||||
) : Serializable
|
@@ -7,5 +7,7 @@ data class GoldToDiamondInfo(
|
||||
val golds: Double,
|
||||
val rate: Double,
|
||||
val maxDiamonds: Long,
|
||||
val minDiamonds: Long
|
||||
val minDiamonds: Long,
|
||||
val maxGolds: Long,
|
||||
val minGolds: Long,
|
||||
) : Serializable
|
@@ -0,0 +1,15 @@
|
||||
package com.yizhuan.xchat_android_core.earn.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
data class WithdrawAccount(
|
||||
val uid: Long,
|
||||
val swift: String,
|
||||
val bankName: String,
|
||||
val accountNumber: String,
|
||||
val accountName: String,
|
||||
val address: String,
|
||||
val city: String,
|
||||
val province: String,
|
||||
val postCode: String
|
||||
) : Serializable
|
@@ -2,12 +2,15 @@ package com.yizhuan.xchat_android_core.earn.model
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||
import com.yizhuan.xchat_android_core.earn.bean.ConfigWithdrawInfo
|
||||
import com.yizhuan.xchat_android_core.earn.bean.EarnRecordInfo
|
||||
import com.yizhuan.xchat_android_core.earn.bean.GoldToDiamondInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.*
|
||||
import com.yizhuan.xchat_android_core.utils.net.launchRequest
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
object EarnModel : BaseModel() {
|
||||
|
||||
@@ -23,6 +26,25 @@ object EarnModel : BaseModel() {
|
||||
api.getGoldToDiamondInfo()
|
||||
}
|
||||
|
||||
suspend fun exchangeConfirm(
|
||||
goldNum: Long,
|
||||
diamondNum: Long,
|
||||
currency: Int
|
||||
): String? =
|
||||
launchRequest {
|
||||
api.exchangeConfirm(goldNum, diamondNum, currency)
|
||||
}
|
||||
|
||||
suspend fun getConfigWithdrawInfo(): ConfigWithdrawInfo? =
|
||||
launchRequest {
|
||||
api.getConfigWithdrawInfo()
|
||||
}
|
||||
|
||||
suspend fun exchange(goldNum: Long, payPwd: String): String? =
|
||||
launchRequest {
|
||||
api.exchange(goldNum, payPwd)
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
@@ -37,6 +59,31 @@ object EarnModel : BaseModel() {
|
||||
@GET("/goldExchangeDiamond/getConfig")
|
||||
suspend fun getGoldToDiamondInfo(): ServiceResult<GoldToDiamondInfo>
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@POST("/goldExchangeDiamond/exchange")
|
||||
suspend fun exchangeConfirm(
|
||||
@Query("goldNum") goldNum: Long,
|
||||
@Query("diamondNum") diamondNum: Long,
|
||||
@Query("currency") currency: Int
|
||||
): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@GET("/withdraw/getConfig")
|
||||
suspend fun getConfigWithdrawInfo(): ServiceResult<ConfigWithdrawInfo>
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@POST("/withdraw/exchange")
|
||||
suspend fun exchange(
|
||||
@Query("goldNum") goldNum: Long,
|
||||
@Query("payPwd") payPwd: String
|
||||
): ServiceResult<String>
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user