package com.adealink.weparty.debug

import android.content.Context
import com.adealink.frame.storage.sp.TypeDelegationPrefs
import com.adealink.frame.util.AppUtil
import com.adealink.weparty.module.profile.ProfileModule
import com.adealink.weparty.network.getLocalHost
import com.adealink.weparty.storage.PREF_DEBUG

object DebugPrefs : TypeDelegationPrefs(
    prefs = {
        AppUtil.appContext.getSharedPreferences(PREF_DEBUG, Context.MODE_PRIVATE)
    },
    userId = {
        ProfileModule.getMyUid()
    }
) {

    var httpUrl: String by PrefKey("key_http_url", "https://${getLocalHost()}/")
    //没有socket长连接
//    var socketUrl: String by PrefKey("key_socket_url", "ws://${getLocalHost()}/websocket")

    var webHttpUrl: String by PrefKey("key_web_http_url", "")

    var webUrlEd: String by PrefKey("key_web_url_ed", "")
    var webWhiteHostEd: String by PrefKey("web_white_host_ed", "")
    var enableSvgaChecker: Boolean by PrefKey("key_enable_svga_checker", true)

    var enableShowSvgaCheckResult: Boolean by PrefKey("key_enable_show_svga_check_result", false)

    var showPerformanceFloatView: Boolean by PrefKey("key_show_performance_float_view", true)

}