package cn.yyxx.eyuancomm.impl

import cn.yyxx.eyuancomm.comm.internal.feature.IFeature
import cn.yyxx.eyuancomm.impl.channel.ChannelSdkYYXX
import cn.yyxx.eyuancomm.impl.channel.huawei.ChannelSdkHuawei
import cn.yyxx.eyuancomm.impl.channel.oppo.ChannelSdkOppo
import cn.yyxx.eyuancomm.impl.channel.vivo.ChannelSdkVivo
import cn.yyxx.eyuancomm.comm.entity.ChannelId

/**
 * @author #Suyghur.
 * Created on 2022/01/17
 */
object SdkGenerator {

    fun getSdkInstance(channelId: String): IFeature? {
        return when (channelId) {
            ChannelId.YYXX -> ChannelSdkYYXX()
            ChannelId.OPPO -> ChannelSdkOppo()
            ChannelId.VIVO -> ChannelSdkVivo()
            ChannelId.HUAWEI -> ChannelSdkHuawei()
            else -> null
        }
    }

    @JvmStatic
    fun getSdkName(channelId: String): String {
        return when (channelId) {
            ChannelId.YYXX -> "yyxx"
            ChannelId.OPPO -> "oppo"
            ChannelId.VIVO -> "vivo"
            ChannelId.HUAWEI -> "huawei"
            else -> ""
        }
    }
}