mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Consistency.
This commit is contained in:
parent
f7b38b0975
commit
ceb55704eb
1 changed files with 7 additions and 7 deletions
|
@ -70,22 +70,22 @@ class SparkServer(val initCallback: (String) -> List<Project>, val cleanUpCallba
|
||||||
result
|
result
|
||||||
})
|
})
|
||||||
jsonRoute("/v0/getTemplates", Route { request, response ->
|
jsonRoute("/v0/getTemplates", Route { request, response ->
|
||||||
TemplatesInfo.create(Templates().getTemplates(pluginInfo))
|
TemplatesData.create(Templates().getTemplates(pluginInfo))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TemplateInfo(val pluginName: String, val templates: List<String>)
|
class TemplateData(val pluginName: String, val templates: List<String>)
|
||||||
|
|
||||||
class TemplatesInfo(val templates: List<TemplateInfo>) {
|
class TemplatesData(val templates: List<TemplateData>) {
|
||||||
companion object {
|
companion object {
|
||||||
fun create(map: ListMultimap<String, ITemplate>) : TemplatesInfo {
|
fun create(map: ListMultimap<String, ITemplate>) : TemplatesData {
|
||||||
val templateList = arrayListOf<TemplateInfo>()
|
val templateList = arrayListOf<TemplateData>()
|
||||||
map.keySet().forEach { pluginName ->
|
map.keySet().forEach { pluginName ->
|
||||||
val list = map[pluginName].map { it.templateName }
|
val list = map[pluginName].map { it.templateName }
|
||||||
templateList.add(TemplateInfo(pluginName, list))
|
templateList.add(TemplateData(pluginName, list))
|
||||||
}
|
}
|
||||||
return TemplatesInfo(templateList)
|
return TemplatesData(templateList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue