package com.adealink.weparty.webview

import com.adealink.weparty.network.CDN_HOST
import com.adealink.weparty.storage.file.FilePath
import com.adealink.weparty.webview.loader.IWebResourceConfig
import com.adealink.weparty.webview.loader.LoaderType

class WebResourceConfig : IWebResourceConfig {

    override val timeoutMS: Long = 60_000L

    override val cachePath: String?
        get() = FilePath.webPath

    override val cacheSizeKB: Long = 20 * 1024 //20M

    override val loaderType: LoaderType
        get() {
            // TODO: 网络加载方式
//            val webConfigJson =
//                globalConfigManager.getConfig(GlobalConfigType.GLOBAL_WEB_CONFIG)?.getOrNull(0)
//            val webConfig: WebConfig = froJsonErrorNull(webConfigJson) ?: return LoaderType.NORMAL
////            return LoaderType.map(webConfig.loaderType)
            return LoaderType.NORMAL
        }
    override val reportHosts: Set<String> =
        emptySet()
        //setOf(CDN_HOST)

}