package com.swago.baseswago.inter

import com.swago.baseswago.model.BenefitModel
import com.swago.baseswago.model.pay.CoinModel
import com.swago.baseswago.model.pay.OrderModel
import com.swago.baseswago.model.pay.PayModel
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 *@date 2021/11/11 22:34
 *description:
 */
interface PayApi {

    /**
     * 商品列表
     */
    @POST("/v1/order/product/list")
    suspend fun getProductList():List<PayModel>


    /**
     * 创建订单
     */
    @FormUrlEncoded
    @POST("/v1/order/add")
    suspend fun createOrder(@Field("product_id")product_id:String):OrderModel


    /**
     *商品列表
     * 1:消费新订单 2:支付失败 3:取消支付 4:上次未被消费的订单
     */
    @FormUrlEncoded
    @POST("/v1/order/pay/callback")
    suspend fun payOrderToServer(@Field("receipt") receipt:String,
                                 @Field("signature") signature:String,
                                 @Field("pay_type") pay_type:Int,
                                 @Field("order_number") order_number:String):Any


    /**
     * 获取用户自己的金币余额
     */
    @POST("/v1/user/coins")
    suspend fun getCoins(): CoinModel

    /**
     * 特惠礼包配置
     */
    @POST("/v1/rtc/discount/package")
    suspend fun getBenefit(): BenefitModel

}