Skip to content

Commit

Permalink
feat: add config default value
Browse files Browse the repository at this point in the history
  • Loading branch information
RealHeart committed Feb 7, 2024
1 parent f1dc739 commit fa4a7af
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions zmusic-core/src/main/kotlin/me/zhenxin/zmusic/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,74 @@ object Config {
* 配置文件版本
*/
val version: Int
get() = config.get("version")
get() = config.get("version") ?: 0

/**
* 调试模式
*
*/
val debug: Boolean
get() = config.get("debug")
get() = config.get("debug") ?: false

/**
* 检查更新
*/
val checkUpdate: Boolean
get() = config.get("check-update")
get() = config.get("check-update") ?: true

/**
* 语言
*/
val language: String
get() = config.get("language")
get() = config.get("language") ?: "auto"

/**
* 消息前缀
*/
val prefix: String
get() = config.get("prefix")
get() = config.get("prefix") ?: "&bZMusic &e>>> &r"

/**
* 网易云音乐API
*/
val neteaseApi: String
get() = config.get("api.netease-api")
get() = config.get("api.netease-api") ?: ""

/** VIP QQ
*
*/
val vipQQ: String
get() = config.get("vip.qq")
get() = config.get("vip.qq") ?: ""

/**
* VIP Key
*/
val vipKey: String
get() = config.get("vip.key")
get() = config.get("vip.key") ?: ""

/**
* 启用代理
*/
val proxyEnable: Boolean
get() = config.get("proxy.enable")
get() = config.get("proxy.enable") ?: false

/**
* 代理类型
*/
val proxyType: String
get() = config.get("proxy.type")
get() = config.get("proxy.type") ?: "HTTP"

/**
* 代理主机
*/
val proxyHost: String
get() = config.get("proxy.host")
get() = config.get("proxy.host") ?: ""

/**
* 代理端口
*/
val proxyPort: Int
get() = config.get("proxy.port")
get() = config.get("proxy.port") ?: 0
}

fun initConfig() {
Expand Down

0 comments on commit fa4a7af

Please sign in to comment.