package com.dlc.exam.common

import com.dlc.exam.sp.EnvConfig
import com.rc.httpcore.config.ConfigParam

/**
 * info
 *
 * @author ReiChin_
 */
object Constants {

    /**
     * 虹软：人脸检查
     */
    object ArcFace {
//        const val APP_ID = "HG2DA2a7JcVshnq7gp6sSgx4evKGB6KoQn7kXweWWds4"
        const val APP_ID = "A3XKg9AUQhgd7RjBk8JKDrVkkoQRd6W9kxm5R2MtAeu1"
//        const val SDK_KEY = "aCzJcPw5XEWVMsVyxtffkFs1ayZ1uYwU72TE9rtSt4w"
        const val SDK_KEY = "HXf4r2UBofUkGPUPQPQKag58YvLvYupjdX51beH497Gx"

        const val FACE_SIMILAR_SCORE = 0.9f
    }

    /**
     * 讯飞：语音合成
     */
    object Iflytek {
        const val APP_ID = "292ac559"
    }

    /**
     * 腾讯：Bugly
     */
    object Bugly {
        const val APP_ID = "fa6c49b171"
    }

    /**
     * 网络请求扩展配置
     */
    object NetExtra {
        const val TOKEN = "Bearer 34c6192c-04a9-4cab-ae28-d61d25253857"
    }

    /**
     * MQTT配置
     */
    object MqttConfig {
        var SERVER_URI = "tcp://42.193.12.99:1883"
        var U_NAME = "dlc"
        var U_PWD = "123456"

        object Topic {
            // 版本更新
            const val APP_UPDATE = "lab/apkup"

            // 心跳
            const val HEART = "bg/heart"

            // 测点数据topic
            const val BULLETIN_BOARD = "lab/function/data"

            // 预警测点topic
            const val WARNING = "lab/wran"

            // 应急topic
            const val EMERGENCY = "lab/news"

            // 物联控制topic
            const val THINGS = "lab/hardware/data"

            // 更新配置
            const val ENV_UPDATE = "lab/upconfig"

            // 轮播图/企业文化图更新
            const val BANNER_IMG = "lab/rotation"
        }

        fun initMqttConfig(config: ConfigParam, envConfig: EnvConfig?) {
            val mqttServerUriSp = envConfig?.mqttServerUri
            val mqttUNameSp = envConfig?.mqttUName
            val mqttUPwdSp = envConfig?.mqttUPwd

            SERVER_URI = if (mqttServerUriSp.isNullOrEmpty()) config.mqttServerUri else mqttServerUriSp
            U_NAME = if (mqttUNameSp.isNullOrEmpty()) config.mqttUName else mqttUNameSp
            U_PWD = if (mqttUPwdSp.isNullOrEmpty()) config.mqttUPwd else mqttUPwdSp
        }
    }

    object Mock {
        // 是否进行活体检测
        const val FACE_LIVENESS = true

        // MQTT
        const val MQTT_TEST = false
        // MQTT client
        const val MQTT_CLIENT_TEST = false

        // 首页看板
        const val BULLETIN_BOARD_TEST = false

        // 登录
        const val LOGIN_TEST = false

        // 设备编码
        const val MACNO_TEST = false

        // 学生卡
        const val STUDENT_NUM_TEST = false
        // 学生编号
        const val STUDENT_NUM = "3032455555" // 3051345110

        // 跳过登录人脸检测
        const val JUMP_LOGON_FACE = false

        const val SETTING_PWD = "admin@098&"
    }

}