package cn.yyxx.eyuangame.core.network

import android.content.Context
import cn.yyxx.support.HostModelUtils

/**
 * @author #Suyghur.
 * Created on 2021/06/17
 */
object Host {

    private const val DEFAULT_ONLINE_HOST = ""
    private const val DEFAULT_TEST_HOST = "http://testsdkapi.eyuangame.com"

    var HOST = ""

    /**
     * 默认线上环境
     */
    var IP_MODEL = 3

    const val BASIC_ROUTE_INIT_SDK = "activate"
    const val BASIC_ROUTE_LOGIN = "member_login"
    const val BASIC_ROUTE_THIRD_PART_LOGIN = "third_plat_login"
    const val BASIC_ROUTE_REGISTER = "member_register"
    const val BASIC_ROUTE_BIND_ACCOUNT = "bind_member_user"
    const val BASIC_ROUTE_BIND_PHONE = "bind_phone"
    const val BASIC_ROUTE_GET_CAPTCHA = "phone_captcha"
    const val BASIC_ROUTE_FORGET_PWD = "forgot_pwd"
    const val BASIC_ROUTE_MODIFY_PWD = "modify_pwd"
    const val BASIC_ROUTE_CREATE_ORDER = "iap_init"
    const val BASIC_ROUTE_NOTIFY_ORDER = "iap_notify"
    const val BASIC_ROUTE_NOTIFY_REWARD = ""
    const val BASIC_ROUTE_SUBMIT_ROLE_INFO = "game_role_report"


    fun initHostModel(context: Context) {
        IP_MODEL = HostModelUtils.getHostModel(context)
        setDefaultHost()
    }

    private fun setDefaultHost() {
        when (IP_MODEL) {
            HostModelUtils.ENV_TEST -> HOST = DEFAULT_TEST_HOST
            HostModelUtils.ENV_ONLINE -> HOST = DEFAULT_ONLINE_HOST
        }
        //初始化接口路由
    }
}