package com.hw.nativeapp.httpnet;


import com.alibaba.fastjson.JSONObject;
import com.hw.nativeapp.BuildConfig;
import com.hw.nativeapp.httpnet.entity.LoginBean;
import com.hw.nativeapp.httpnet.entity.LoginRequestBean;
import com.hw.nativeapp.httpnet.entity.ResponseData;
import com.hw.nativeapp.httpnet.entity.UpdateVerAskBean;
import com.hw.nativeapp.httpnet.entity.UpdateVerReqBean;

import java.util.Map;

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

/**
 * @create by ywq
 * @date 2020/5/12
 * @description :
 */
public interface ApiService {
    String COMMON= BuildConfig.API_PATH;

    //登录
    @POST(COMMON + "/system/deviceInfo/selfLogin")
    Observable<ResponseData<LoginBean>> login(
            @Body LoginRequestBean bean,
            @Query("t") Long currtime
            );

    //版本升级
    @POST(COMMON + "/system/appversion/upgrade-by-appid")
    Observable<ResponseData<UpdateVerAskBean>> version(
            @Body UpdateVerReqBean bean,
            @Query("t") Long currtime
    );

    //用户信息
    @GET(COMMON + "/system/client/selfIndex")
    Observable<ResponseData<JSONObject>> selfIndex(
            @Query("t") Long currtime
    );

    //查询票列表
    @GET(COMMON + "/order/orderInfo/getValidList")
    Observable<ResponseData<JSONObject>> getValidList(@QueryMap Map< String,String> options,
                                                     @Query("t") Long currtime);

    //出票
    @POST(COMMON + "/order/orderInfo/ticketout")
    Observable<ResponseData<JSONObject>> ticketout(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

    //获取节目列表
    @GET(COMMON + "/goods/performInfo/selectAll")
    Observable<ResponseData<JSONObject>> selectAll(@QueryMap Map< String,String> options,
                                                      @Query("t") Long currtime);
    //节目ID获取演艺厅信息
    @GET(COMMON + "/goods/performInfo/performSell")
    Observable<ResponseData<JSONObject>> performSell(@QueryMap Map< String,String> options,
                                                    @Query("t") Long currtime);

    //获取节目演出日期
    @GET(COMMON + "/merchant/merchantTheatreAuditorium/selectDate")
    Observable<ResponseData<JSONObject>> selectDate(@QueryMap Map< String,String> options,
                                                   @Query("t") Long currtime);

    //获取节目演出时段
    @GET(COMMON + "/merchant/merchantTheatreAuditorium/selectTimes")
    Observable<ResponseData<JSONObject>> selectTimes(@QueryMap Map< String,String> options,
                                                    @Query("t") Long currtime);
    // 选择区域
    @POST(COMMON + "/merchant/merchantTheatreAuditorium/selectRegion")
    Observable<ResponseData<JSONObject>> selectRegion(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

    // 二要数认证
    @POST(COMMON + "/thirdapi/identity/factorAuth")
    Observable<ResponseData<JSONObject>> factorAuth(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

    // 订单提交
    @POST(COMMON + "/order/orderInfo/submit")
    Observable<ResponseData<JSONObject>> orderSubmit(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

    // 订单支付
    @POST(COMMON + "/order/orderInfo/gotoNativePay")
    Observable<ResponseData<JSONObject>> gotoNativePay(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

    // 支付查询
    @POST(COMMON + "/order/orderInfo/payQuery")
    Observable<ResponseData<JSONObject>> payQuery(
            @Body JSONObject bean,
            @Query("t") Long currtime
    );

}
