package com.zxhl.cms.net.api;

import com.zxhl.cms.ad.upload.model.Response;
import com.zxhl.cms.common.NetConfig;
import com.zxhl.cms.net.model.uc.AliPayEntity;
import com.zxhl.cms.net.model.uc.PayMinEntity;
import com.zxhl.cms.net.model.uc.PayVerifyEntity;
import com.zxhl.cms.net.model.uc.UserInfo;
import com.zxhl.cms.net.model.uc.VideoProcessEntity;
import com.zxhl.cms.net.model.uc.VideoResultEntity;
import com.zxhl.cms.net.model.uc.WeChatPayEntity;
import com.zxhl.cms.net.model.video.MemberEntity;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by gaoleichao on 2018/5/2.
 */

public interface IUserInfoApi {

    /**
     * 上传设备信息
     *
     * @return
     */
    @POST(NetConfig.User.URL_USER_DEVICE_LOGIN)
    Observable<Response<UserInfo>> deviceLogin();

    /**
     * 获取用户资料
     *
     * @return
     */
    @GET(NetConfig.User.URL_USER_GET_USERINFO_)
    Observable<Response<UserInfo>> getUserInfo();


    /**
     * 获取用户资料
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_ORDER)
    Observable<Response<WeChatPayEntity>> wechatPay(@Query("goodsId") String goodsId,
                                                    @Query("payType") String payType,
                                                    @Query("voucherId") String voucherId,
                                                    @Query("appId") String appId,
                                                    @Query("payMode") String payMode);

    /**
     * 获取用户资料
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_ORDER)
    Observable<Response<PayMinEntity>> MinPay(@Query("goodsId") String goodsId,
                                              @Query("payType") String payType,
                                              @Query("voucherId") String voucherId,
                                              @Query("appId") String appId,
                                              @Query("payMode") String payMode);

    /**
     * 微信小程序支付
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_ORDER)
    Observable<Response<WeChatPayEntity>> miniProgromPay(@Query("goodsId") String goodsId, @Query("payType") String payType, @Query("voucherId") String voucherId, @Query("appId") String appId);


    /**
     * 支付宝支付
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_ORDER)
    Observable<Response<AliPayEntity>> aliPay(@Query("goodsId") String goodsId, @Query("payType") String payType, @Query("voucherId") String voucherId, @Query("appId") String appId, @Query("payMode") String payMode);


    /**
     * 商城商品支付宝支付
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_SHOP_ORDER)
    Observable<Response<AliPayEntity>> shopaliPay(@Query("goodsId") String goodsId, @Query("payType") String payType, @Query("payMode") String payMode, @Query("addressId") String addressId, @Query("discount") String discount, @Query("goodIds") String goodIds, @Query("orderNotes") String orderNotes);

    /**
     * 商城微信支付
     *
     * @return
     */
    @POST(NetConfig.User.URL_PAY_SHOP_ORDER)
    Observable<Response<WeChatPayEntity>> shopwechatPay(@Query("goodsId") String goodsId, @Query("payType") String payType, @Query("payMode") String payMode, @Query("addressId") String addressId, @Query("discount") String discount, @Query("goodIds") String goodIds, @Query("orderNotes") String orderNotes);

    /**
     * 获取用户资料
     *
     * @return
     */
    @GET(NetConfig.User.VERIFY_PAY_URL)
    Observable<Response<PayVerifyEntity>> verifyPay(@Query("outTradeNo") String outTradeNo, @Query("tradeNo") String tradeNo, @Query("payType") int payType);

    /**
     * 获取用户资料
     *
     * @return
     */
    @GET(NetConfig.User.VERIFY_PAY_SWITCH_URL)
    Observable<Response<PayVerifyEntity>> queryPaySwitch();

    /**
     * 获取用户试用进度
     *
     * @return
     */
    @POST(NetConfig.User.USER_FREE_PROGRESS)
    Observable<Response<VideoProcessEntity>> getuserProgress();

    /**
     * 判断弹窗
     *
     * @return
     */
    @POST(NetConfig.User.USER_CHECK_FREE_TRIALV3)
    Observable<Response<VideoProcessEntity>> checkFreeTrial();

    /**
     * 视频上报
     *
     * @return
     */
    @POST(NetConfig.User.USER_FREE_REPORT)
    Observable<Response<VideoResultEntity>> freeReport();

    /**
     * 支付配置-v2 - 支持打折 和 优惠卷
     *
     * @return
     */
    @GET(NetConfig.User.USER_PAY_CONFIG)
    Observable<Response<MemberEntity>> userPayConfig(@Query("payMode") String payMode);

    /**
     * 试用领取
     *
     * @return
     */
    @POST(NetConfig.User.USER_FREE_RECEIVE)
    Observable<Response<VideoProcessEntity>> freeReceive(@Query("type") int type);
}
