SearchApi.kt 3.99 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.*
upwork.021 committed
10
import com.yidianling.consultant.model.bean.ExpertBean
11
import com.yidianling.consultant.model.bean.FunctionWordBean
12 13 14 15 16 17 18 19 20 21 22 23 24 25
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

严久程 committed
26
        fun getSearchApi(): SearchApi {
27 28 29 30 31 32 33 34 35 36 37 38 39
            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>>

    //搜索条件
upwork.021 committed
40
    @GET("consult/search/v3/conditions")
严久程 committed
41
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
42
    fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
43

44 45 46 47
    //查询功能词、底纹词
    //(1热门词,2底纹词,3跳转词)
    @POST("function/word/queryList")
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
霍志良 committed
48
    fun searchFunctionWord(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>>
upwork.021 committed
49

50 51 52 53
    //查询功能词、底纹词
    //(1热门词,2底纹词,3跳转词)
    @POST("function/word/queryList")
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
霍志良 committed
54
    fun searchFunctionWordApi(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<MutableList<FunctionWordConsultBean>>>
55

upwork.021 committed
56 57 58
    /**
     * 新咨询师列表接口(包含搜索、筛选咨询师)
     */
59
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "X-App-Id: plough_cloud")
upwork.021 committed
60
    @POST("smart-rank/v1/search")
61
    fun getExpertList(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<ExpertBean>>
upwork.021 committed
62

upwork.021 committed
63 64 65 66 67 68 69
    /**
     * 获取搜索联想词
     */
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
    @POST("dmp/v1/searchsuggest")
    fun getSearchWords(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<SearchWordsBean>>

70 71

    //搜索页面接口
严久程 committed
72
    @retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
73 74 75 76 77 78
    @GET("home/search-page")
    fun searchPage(): Observable<BaseAPIResponse<HotSearchBean>>

    //筛选结果计数
    @retrofit2.http.Headers("Content-Type:application/json")
    @GET
严久程 committed
79
    fun getFilterCount(@Url url: String?): Observable<BaseAPIResponse<Int>>
80 81

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

86
    //获取咨询助理uid
严久程 committed
87
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
88
    @POST("doctor/querySpecialTopic")
89
    fun getBigShotData(@Body map: Map<String,@JvmSuppressWildcards Any>): Observable<BaseAPIResponse<ExpertSearchTopShowBean>>
严久程 committed
90 91 92 93 94


    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
    @GET("testGeneral/daoyi/setting")
    fun getGuideData(): Observable<BaseAPIResponse<Map<String, List<GuideBean>>>>
95 96 97 98 99 100 101 102

    //8-22点跳自主,其他时间跳导医,
    // 0 自主默认
    //1 自主
    //2 导医
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
    @GET("consult/assistant/chat-time-setting")
    fun getJumpTypeRequest(): Observable<BaseAPIResponse<Int>>
103 104 105 106 107 108 109 110 111 112 113 114

    /**
     * 100 有配置接口
     * */
    @GET("consult/assistant/chat-route-config")
    @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
    fun getChatRouteConfig(
        @Query("location") location: Int,
        @Query("naviType") naviType: String = "1"
    ): Observable<BaseAPIResponse<Long>>


115
}