package com.dlc.eboard.common

import com.dlc.eboard.sp.EnvConfig
import com.rc.httpcore.HttpConfig
import com.rc.httpcore.config.ConfigParam

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

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

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

    /**
     * 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 CHECK_MACHINE = "lab/check"

            // 通知信息
            const val NOTICE_MSG = "lab/content"

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

            // 实验室信息更新
            const val LAB_INFO = "lab/subInfo"

            // 实验室图片更新
            const val SYS_IMG = "sys/logo"
        }

        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 {
        // MQTT
        const val MQTT_TEST = false
        // MQTT client
        const val MQTT_CLIENT_TEST = false

        // 设备编码
        const val MACNO_TEST = false

        // 学生卡
        const val SCHOOL_NUM_TEST = false
//        const val SCHOOL_NUM = "0459114995"
//        const val SCHOOL_NUM = "0201246571"
        const val SCHOOL_NUM = "303435393131343939350D0A" // 一类
//        const val SCHOOL_NUM = "303436303237393337390D0A" // 二类

        const val SETTING_PWD = "admin@098&"

        // 签到/签退白名单: ①签到时，跳过AI检测；②签退时，跳过安全检查
        val SIGN_WHITE_LIST = emptyList<String>()

        // 是否跳过人脸验证
        const val JUMP_FACE_AUTH = false

        // 指纹登记方式：template
        const val FINGER_ENROLL_TEMPLATE = 1
        // 指纹登记方式：feature
        const val FINGER_ENROLL_FEATURE = 2
        const val FINGER_ENROLL_MODE = FINGER_ENROLL_FEATURE
    }

}