package com.aiosman.riderpro

import android.content.Context

object ConstVars {
    // api 地址
//    const val BASE_SERVER = "http://192.168.31.130:8088"
//    const val BASE_SERVER = "http://192.168.142.140:8088"
//        const val BASE_SERVER = "https://8.137.22.101:8088"
     const val BASE_SERVER = "https://rider-pro.aiosman.com/beta_api"

    const val MOMENT_LIKE_CHANNEL_ID = "moment_like"
    const val MOMENT_LIKE_CHANNEL_NAME = "Moment Like"

    /**
     * 上传头像图片大小限制
     * 10M
     */
    const val AVATAR_FILE_SIZE_LIMIT = 1024 * 1024 * 10

    /**
     * 上传头像图片压缩时最大的尺寸
     * 512
     */
    const val AVATAR_IMAGE_MAX_SIZE = 512

    /**
     * 上传 banner 图片大小限制
     */
    const val BANNER_IMAGE_MAX_SIZE = 2048

    // 用户协议地址
    const val DICT_KEY_PRIVATE_POLICY_URL = "private_policy"
    // 重置邮箱间隔
    const val DIC_KEY_RESET_EMAIL_INTERVAL = "send_reset_password_timeout"
}
//
enum class ErrorCode(val code: Int) {
    USER_EXIST(40001),
    USER_NOT_EXIST(40002),
    InvalidateCaptcha(40004),
}

fun Context.getErrorMessageCode(code: Int?): String {
    return when (code) {
        10001 -> getString(R.string.error_10001_user_exist)
        else -> getString(R.string.error_unknown)
    }
}