package com.mogo.cloud.live.network;

import com.mogo.cloud.live.model.BaseData;
import com.mogo.cloud.live.model.Camera;
import com.mogo.cloud.live.model.LiveCamera;
import com.mogo.cloud.live.model.LiveReceive;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.QueryMap;

/**
 * 直播功能使用到的接口
 */
public interface LiveApiServer {
    /**
     * 获取特定车辆直播Url
     *
     * @param designativeVehicleHeadLiveMap 请求数据
     * @return {@link BaseData}
     */
    @FormUrlEncoded
    @POST("eagle-eye-dns/dataSave/integratedServices/app/push/no/livePushAndSwitch/v1")
    Observable<BaseData> getDesignativeVehicleLive(@FieldMap Map<String, String> designativeVehicleHeadLiveMap);

    /**
     * 获取前方车辆直播Url
     *
     * @param frontVehicleHeadLiveMap 请求数据
     * @return {@link BaseData}
     */
    @FormUrlEncoded
    @POST("eagle-eye-dns/yycp-geo-fence-carService/front/car")
    Observable<BaseData<LiveReceive>> getFrontVehicleLive(@FieldMap Map<String, String> frontVehicleHeadLiveMap);

    /**
     * 获取前方路口直播Url
     *
     * @param frontIntersectionLiveMap 请求数据
     * @return {@link BaseData}
     */
    @FormUrlEncoded
    @POST("eagle-eye-dns/yycp-geo-fence-carService/front/crossing")
    Observable<BaseData<LiveReceive>> getFrontIntersectionLive(@FieldMap Map<String, String> frontIntersectionLiveMap);

    /**
     * 获取固定路口摄像头直播Url
     *
     * @return {@link BaseData}
     */
    @GET("eagle-eye-dns/mec-etl-server/device/unit/camera/live")
    Observable<BaseData<LiveCamera>> getDesignativeIntersectionLive(@QueryMap Map<String, Object> parameters);

    /**
     * 上传摄像头状态
     *
     * @return {@link BaseData}
     */
    @POST("eagle-eye-dns/alarm/car/video/reportCameraStatus")
    Observable<BaseData> reportCameraStatus(@Body RequestBody parameters);
}
