package com.gh.gamecenter.energy.provider

import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IEnergyTaskProvider
import com.gh.gamecenter.energy.utils.EnergyTaskHelper
import com.gh.gamecenter.energy.utils.IntegralLogHelper
import com.gh.gamecenter.energy.view.EnergyCenterActivity
import com.gh.gamecenter.energy.view.EnergyHouseActivity

@Route(path = RouteConsts.provider.energyTask, name = "EnergyTask暴露服务")
class EnergyTaskProviderImpl : IEnergyTaskProvider {
    override fun postEnergyTaskForShare(type: String, id: String, url: String) {
        EnergyTaskHelper.postEnergyTaskForShare(type, id, url)
    }

    override fun logInviteResult(result: String, type: String?) {
        IntegralLogHelper.logInviteResult(result, type)
    }

    override fun postEnergyTask(action: String) {
        EnergyTaskHelper.postEnergyTask(action)
    }

    override fun postInviteCodeTask(code: String, from: String, callback: (() -> Unit)?) {
        EnergyTaskHelper.postInviteCodeTask(code, from, callback)
    }

    override fun getEnergyCenterIntent(context: Context?): Intent? {
        return EnergyCenterActivity.getIntent(context)
    }

    override fun getEnergyCenterIntent(context: Context?, initTabIndex: Int): Intent? {
        return EnergyCenterActivity.getIntent(context, initTabIndex)
    }

    override fun getEnergyHouseIntent(context: Context?, categoryId: String?): Intent? {
        return EnergyHouseActivity.getIntent(context, categoryId)
    }

    override fun postEnergyTask(action: String, id: String) {
        EnergyTaskHelper.postEnergyTask(action, id)
    }

    override fun postEnergyTask(action: String, id: String, packageName: String) {
        EnergyTaskHelper.postEnergyTask(action, id, packageName)
    }

    override fun postEnergyTask(action: String, id: String?, packageName: String?, url: String?) {
        EnergyTaskHelper.postEnergyTask(action, id, packageName, url)
    }

    override fun init(context: Context?) {

    }
}