package com.gh.common.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConfigProvider

@Route(path = RouteConsts.provider.config, name = "Config暴露服务")
class ConfigProviderImpl : IConfigProvider {
    override fun getTencentAppId(): String {
        return Config.TENCENT_APPID
    }

    override fun getWechatAppId(): String {
        return Config.WECHAT_APPID
    }

    override fun getWechatSecret(): String {
        return Config.WECHAT_SECRET
    }

    override fun getUploadLimitSize(): Long {
        return Config.getSettings()?.image?.uploadLimitSize ?: 0L
    }

    override fun getSize(): Int {
        return Config.getSettings()?.image?.size ?: 0
    }

    override fun getRatio(): Int {
        return Config.getSettings()?.image?.ratio ?: 0
    }

    override fun getQuality(): Int {
        return Config.getSettings()?.image?.quality ?: 0
    }

    override fun getGif(): String {
        return Config.getSettings()?.image?.oss?.gif ?: ""
    }

    override fun getJpeg(): String {
        return Config.getSettings()?.image?.oss?.jpeg ?: ""
    }

    override fun getWebp(): String {
        return Config.getSettings()?.image?.oss?.webp ?: ""
    }

    override fun getGitThumb(): String {
        return Config.getSettings()?.image?.oss?.gitThumb ?: ""
    }

    override fun getGifWaterMark(): String {
        return Config.getSettings()?.image?.oss?.gifWaterMark ?: ""
    }

    override fun getQQ(): String {
        return Config.getSettings()?.support?.qq ?: ""
    }

    override fun getQuickLoginAppId(): String {
        return Config.QUICK_LOGIN_APPID
    }

    override fun getQuickLoginAppKey(): String {
        return Config.QUICK_LOGIN_APPKEY
    }

    override fun getWeiboAppKey(): String {
        return Config.WEIBO_APPKEY
    }

    override fun getNightModeSetting(): Boolean {
        return Config.getNightModeSetting()?.setting ?: false
    }

    override fun init(context: Context?) {
        // Do nothing
    }
}