package com.ydl.audioim.http

import com.ydl.audioim.bean.AgoraTokenResponse
import com.ydl.audioim.bean.ConnectBean
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author jiucheng
 * @描述:声网业务接口api
 * @Copyright Copyright (c) 2018
 * @Company 壹点灵
 * @date 2018/11/9
 */
interface AudioNetAPi {
    /**
     * 通话开始回调
     */
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @POST("auth/listen-order/callback/agora/start")
    fun connectStart(@Body body:RequestBody): Observable<BaseAPIResponse<Any>>

    /**
     * 通话结束回调
     */
    @Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @POST("auth/listen-order/callback/agora/finish")
    fun connectFinish(@Body body:RequestBody): Observable<BaseAPIResponse<Any>>


    /**
     * 链接 ：获取axb手机号
     */
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @GET("auth/listen/dial")
    fun connectListen(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<ConnectBean>>

    /**
     *通知服务端发送推送
     */
    @POST("api/push/notify/doctor")
    fun noticeServerPush(@Body body: RequestBody): Observable<BaseResponse<Any>>

    /**
     * 获取声网登录token
     */
    @Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @GET("im/getAgoraToken")
    fun getAgoraToken(@Query("uid") uid: String?): Observable<BaseAPIResponse<AgoraTokenResponse>>
}