package com.dlc.chemical.common

import android.hardware.Camera
import com.dlc.chemical.sp.EnvConfig
import com.rc.httpcore.HttpConfig
import com.rc.httpcore.config.ConfigParam

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

    /**
     * 虹软：人脸检查
     */
    object ArcFace {
        const val APP_ID = "A3XKg9AUQhgd7RjBk8JKDrVkkoQRd6W9kxm5R2MtAeu1"
        const val SDK_KEY = "HXf4r2UBofUkGPUPQPQKag58YvLvYupjdX51beH497Gx"
        const val FACE_SIMILAR_SCORE = 0.9f
    }

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

    /**
     * 网络请求扩展配置
     */
    object NetExtra {
//        const val TOKEN = "Bearer 306431ac-e664-41fa-89ef-cd8dc3bc8704"
//        const val TOKEN = "Bearer 5af98eb3-4b90-4eb3-8a8f-60dffb9e9d52"
        const val TOKEN = ""
//        val API_VERSION = HttpConfig.ApiVersion.V1.code
        val API_VERSION = HttpConfig.ApiVersion.V2.code
    }

    object CameraConfig {
        const val CAMERA_ID_FACE = Camera.CameraInfo.CAMERA_FACING_BACK
        const val CAMERA_ID_VIDEO = Camera.CameraInfo.CAMERA_FACING_FRONT
    }

    /**
     * MQTT配置
     */
    object MqttConfig {
        //var SERVER_URI = "tcp://42.193.12.99:1883"
        var SERVER_URI = "tcp://192.168.0.248:1883"
        var U_NAME = "mqtt"
        var U_PWD = "mqtt@zd1883"

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

            // 心跳
            const val HEART = "lab/chemical/"
            const val HEART_OFF = "lab/off-chemical/"

            // 化学品柜开关锁
            const val CABINET_LOCK = "lab/cabinetLock/"

            // 测点数据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 TEST_ENV = false
        // 是否进行活体检测
        const val FACE_LIVENESS = true

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

        // 设备编码
        const val MACNO_TEST = false

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

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

        const val SETTING_PWD = "admin@098&"

        // 双人双卡
        const val TWO_PERSON_AUTH_TEST = false
        // 人员卡号
        val AUTH_PERSON_LIST = listOf("3F893B05", "0BF0CFAB")

        // 是否使用新的领用流程
        const val USE_FLOW_NEWLY = true
    }

}