package com.adealink.weparty.wallet.datasource.remote

import com.adealink.frame.base.Rlt
import com.adealink.frame.network.data.Res
import com.adealink.weparty.wallet.data.WalletRes
import com.adealink.weparty.wallet.recharge.data.ConvertCurrencyReq
import com.adealink.weparty.wallet.recharge.data.CurrencyExchangedConfigRes
import com.adealink.weparty.wallet.recharge.data.PayFailReq
import com.adealink.weparty.wallet.recharge.data.PaySuccessReq
import com.adealink.weparty.wallet.recharge.data.PreConvertReq
import com.adealink.weparty.wallet.recharge.data.PreConvertRes
import com.adealink.weparty.wallet.recharge.data.PrePurchaseReq
import com.adealink.weparty.wallet.recharge.data.PrePurchaseRes
import com.adealink.weparty.wallet.recharge.data.RechargeConfigReq
import com.adealink.weparty.wallet.recharge.data.RechargeConfigRes
import retrofit2.http.Body
import retrofit2.http.Core
import retrofit2.http.POST

interface WalletHttpService {

    @Core
    @POST("user/my/wallet")
    suspend fun pullWallet(): Rlt<Res<WalletRes>>

    @POST("wallet/recharge/goods")
    suspend fun rechargeConfig(@Body req: RechargeConfigReq): Rlt<Res<RechargeConfigRes>>

    @POST("wallet/exchange")
    suspend fun convertCurrency(@Body req: ConvertCurrencyReq): Rlt<Res<Any>>

    @POST("wallet/recharge/submit")
    suspend fun prePurchase(@Body req: PrePurchaseReq): Rlt<Res<PrePurchaseRes>>

    @POST("wallet/recharge/goods/payBak")
    suspend fun purchaseSuccess(@Body req: PaySuccessReq): Rlt<Res<Any>>


    @POST("wallet/recharge/cancel")
    suspend fun purchaseFail(@Body req: PayFailReq): Rlt<Res<Any>>

    @Core
    @POST("base/consts/config")
    suspend fun getCurrencyExchangeConfig(): Rlt<Res<CurrencyExchangedConfigRes>>


    @POST("wallet/exchange/pre")
    suspend fun preConvert(@Body req: PreConvertReq): Rlt<Res<PreConvertRes>>
}