mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-30 06:37:29 +00:00
refactor(config): 更改部分配置类的属性默认值.
为了保证扩展中命令的权限判断有效性, 故移除 BotAccount 中 creatorId 字段的默认值, 此改动将要求用户提供准确的 Bot 创建者 Id. 这个改动拖得越久, 影响的范围就越大. 另外, 为 BotConfig 中的 extensions 属性和 proxy 属性增加默认值, 以减少意义重复的情况(例如当用户没设置 proxy 属性时提供一个 type 为 NO_PROXY 的 ProxyConfig, 无需判断是否为 null).
This commit is contained in:
parent
a2667438f2
commit
b12758bd18
@ -15,7 +15,7 @@ import java.net.URL
|
|||||||
data class BotAccount(
|
data class BotAccount(
|
||||||
val name: String,
|
val name: String,
|
||||||
val token: String,
|
val token: String,
|
||||||
val creatorId: Long = -1
|
val creatorId: Long
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val id
|
val id
|
||||||
@ -43,8 +43,8 @@ data class BotConfig(
|
|||||||
* 而构件坐标(POM Reference 或者叫 GAV 坐标)是开发者创建 Maven/Gradle 项目时一定会设置的,
|
* 而构件坐标(POM Reference 或者叫 GAV 坐标)是开发者创建 Maven/Gradle 项目时一定会设置的,
|
||||||
* 所以就直接用了. :P
|
* 所以就直接用了. :P
|
||||||
*/
|
*/
|
||||||
val extensions: Set<Artifact>,
|
val extensions: Set<Artifact> = emptySet(),
|
||||||
val proxy: ProxyConfig? = ProxyConfig(),
|
val proxy: ProxyConfig = ProxyConfig(type = ProxyType.NO_PROXY),
|
||||||
val baseApiUrl: String? = ApiConstants.BASE_URL
|
val baseApiUrl: String? = ApiConstants.BASE_URL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user