package com.hongyegroup.nucleicacidtest.router

import android.app.Activity
import com.guadou.cs_router.app.IAppComponentServer
import com.guadou.lib_baselib.utils.CommUtils
import com.guadou.lib_baselib.utils.Log.YYLogUtils
import io.github.prototypez.appjoint.core.ServiceProvider

@ServiceProvider
class AppComponentImpl : IAppComponentServer {

    override fun initSMS(): IAppComponentServer {

        return this
    }

    override fun sendSMSCode(
        activity: Activity,
        phone: String,
        sendAction: ((isSuccess: Boolean) -> Unit)?,
        verifyAction: ((isSuccess: Boolean) -> Unit)?
    ) {

    }

    override fun verifySMSCode(activity: Activity, code: String, verifyAction: ((isSuccess: Boolean) -> Unit)?) {
        //模拟成功
        YYLogUtils.w("开始模拟")
        CommUtils.getHandler().postDelayed({
            YYLogUtils.w("模拟成功")
            verifyAction?.let { it(true) }
        }, 1000)
    }

}