package com.gh.common.provider

import android.content.Context
import com.therouter.router.Route
import com.gh.common.util.LibaoUtils
import com.gh.common.util.LibaoUtils.PostLibaoListener
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ILibaoUtilsProvider

@com.therouter.inject.ServiceProvider
class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
    override fun getLibaoStatus(ids: String, successCallback: ((Any?) -> Unit)?, failureCallback: (() -> Unit)?) {
        LibaoUtils.getLibaoStatus(ids, object : PostLibaoListener {
            override fun postSucceed(response: Any?) {
                successCallback?.invoke(response)
            }

            override fun postFailed(error: Throwable?) {
                failureCallback?.invoke()
            }
        })
    }
}