Merge remote-tracking branch 'origin/master'

This commit is contained in:
ryoii 2020-03-30 20:41:04 +08:00
commit 479bae0365
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package net.mamoe.mirai.console.center
object CuiPluginCenter: PluginCenter{
override suspend fun fetchPlugin(page: Int): Map<String, PluginCenter.PluginInsight> {
TODO("Not yet implemented")
}
override suspend fun findPlugin(name: String): PluginCenter.PluginInfo? {
TODO("Not yet implemented")
}
}

View File

@ -0,0 +1,49 @@
package net.mamoe.mirai.console.center
interface PluginCenter {
companion object{
val Default:PluginCenter = CuiPluginCenter
}
data class PluginInsight(
val name:String,
val version:String,
val coreVersion:String,
val consoleVersion:String,
val author:String,
val description: String,
val tags:List<String>,
val commands:List<String>,
)
data class PluginInfo(
val name:String,
val version:String,
val coreVersion:String,
val consoleVersion:String,
val tags:List<String>,
val author:String,
val contact:String,
val description: String,
val usage:String,
val vcs:String,
val commands:String,
val changeLog:List<String>
)
/**
* 获取一些中心的插件基本信息,
* 能获取到多少由实际的PluginCenter决定
* 返回 插件名->Insight
*/
suspend fun fetchPlugin(page: Int) :Map<String,PluginInsight>
/**
* 尝试获取到某个插件by全名, case sensitive
* null则没有
*/
suspend fun findPlugin(name:String):PluginInfo?
}