package com.yidianling.ydlcommon.custom.http

import com.yidianling.ydlcommon.custom.http.response.Balance
import com.yidianling.ydlcommon.custom.http.response.Recharge
import com.yidianling.ydlcommon.custom.http.response.TestAddOrderBean
import com.yidianling.ydlcommon.custom.http.response.WXPay
import com.yidianling.ydlcommon.custom.pay.redpacket.RedPacketBean
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * author : Zhangwenchao
 * e-mail : zhangwch@yidianling.com
 * time   : 2018/04/18
 */
interface YdlCommonApi {

    //账户余额
    @FormUrlEncoded
    @POST("uc/mybalance")
    fun getBalance(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Balance>>

    //获得充值单号
    @FormUrlEncoded
    @POST("pay/recharge")
    fun recharge(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>>

    //微信充值
    @FormUrlEncoded
    @POST("pay/recharge-wx-option")
    fun wxRecharge(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>>

    //余额支付
    @FormUrlEncoded
    @POST("pay/vcount-pay")
    fun pay(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>>

    //微信在线支付
    @FormUrlEncoded
    @POST("pay/to-pay")
    fun wxPay(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>>

    //获取充值单号（微信的payid to 支付宝的payid）
    @FormUrlEncoded
    @POST("pay/get-recharge")
    fun aliPay(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>>

    //获取用户所有测试红包列表，按优惠金额倒序排序
    @FormUrlEncoded
    @POST("ceshi/coupon")
    fun getCoupon(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<ArrayList<RedPacketBean>>>

    //测评下单接口
    @FormUrlEncoded
    @POST("ceshi/add-order")
    fun testAddOrder(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<TestAddOrderBean>>

    //测评下单接口
    @FormUrlEncoded
    @POST("ceshi/redlist")
    fun getRedList(@FieldMap params: Map<String, String>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>>

    @POST("uc/log")
    @Multipart
    fun uploadLog(@PartMap params: MutableMap<String, RequestBody>): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>>

}