HomeHttp.kt 918 Bytes
Newer Older
徐健 committed
1 2
package com.yidianling.home.http

徐健 committed
3 4
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
5
import com.yidianling.home.model.bean.MuseModuleBean
徐健 committed
6 7 8 9 10 11 12 13 14
import io.reactivex.Observable

/**
 * @author jiucheng
 * @描述:首页接口实现类
 * @Copyright Copyright (c) 2018
 * @Company 壹点灵
 * @date 2018/8/22
 */
15
class HomeHttp {
徐健 committed
16 17 18 19 20 21 22 23 24 25 26

    companion object {
        fun getInstance(): HomeHttp {
            return Holder.INSTANCE
        }
    }

    object Holder {
        val INSTANCE = HomeHttp()
    }

27
    private var homeApi: HomePagerApi? = null
徐健 committed
28

29 30 31
    private fun getHomePagerApi(): HomePagerApi {
        if (homeApi == null) {
            homeApi = YDLHttpUtils.obtainApi(HomePagerApi::class.java)
徐健 committed
32
        }
33
        return homeApi!!
徐健 committed
34 35 36 37
    }

    //壹点冥想
    fun newMuseRequest(): Observable<BaseAPIResponse<MuseModuleBean>> {
38
        return getHomePagerApi().getMuseData()
徐健 committed
39 40
    }
}