SearchApi.kt 2.5 KB
Newer Older
1 2 3 4 5 6 7 8
package com.yidianling.consultant.model


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 com.ydl.ydlnet.YDLHttpUtils
9
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable
import retrofit2.http.*


/**
 * Created by zqk on 17-10-26.
 */
interface SearchApi {

    companion object {

        var instance: SearchApi? = null

        fun getSearchApi():SearchApi {
            if (instance == null) {
                instance = YDLHttpUtils.obtainApi(SearchApi::class.java)
            }
            return instance!!
        }
    }

    //服务列表头部
    @POST("product/list-head")
    @FormUrlEncoded
    fun listHead(@FieldMap maps: Map<String, String>): Observable<BaseResponse<HeadData>>

    //搜索条件
    @GET("consult/search/conditions")
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
    fun searchConditions(): Observable<BaseAPIResponse<HeadData>>

    //专家服务搜索
    @retrofit2.http.Headers("Content-Type:application/json")
    @GET
    fun searchDoctorService(@Url url : String): Observable<BaseAPIResponse<ExpertSearchBean>>

    //搜索页面接口
    @retrofit2.http.Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @GET("home/search-page")
    fun searchPage(): Observable<BaseAPIResponse<HotSearchBean>>

    //筛选结果计数
    @retrofit2.http.Headers("Content-Type:application/json")
    @GET
    fun getFilterCount(@Url url : String?): Observable<BaseAPIResponse<Int>>
59 60 61 62 63 64 65 66 67 68

    //导医
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @GET("consult/assistant/guide-switch")
    fun getConsultAssistantRequest(@Query("switchKey") switchKey: String): Observable<BaseAPIResponse<Boolean>>

    //获取咨询助理uid
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @GET("consult/assistant/chat-distribute")
    fun getConsultAssistantUidRequest(): Observable<BaseAPIResponse<Long>>
69 70 71 72 73

    //获取咨询助理uid
    @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
    @POST("doctor/querySpecialTopic")
    fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>>
74
}