package com.yidianling.consultant.model

import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import com.yidianling.consultant.model.bean.FunctionWordBean
import io.reactivex.Observable

/**
 * @author yuanwai
 * @描述:测评首页数据模型实现类
 * @Copyright Copyright (c) 2018
 * @Company 壹点灵
 * @date 2018/7/26
 */
class HotSearchModelImpl : IHotSearchContract.Model {
    override fun searchData(): Observable<HotSearchBean> {
        return HotSearchDataManager.getHttp().searchData().compose(RxUtils.resultJavaData())
    }

    override fun getSearchWords(map: HashMap<String, Any>): Observable<SearchWordsBean> {
        return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData())
    }

    override fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> {
        return HotSearchDataManager.getHttp().searchHotWordData(map)
    }
}