mirror of https://github.com/usbharu/Hideout.git
style: fix lint (CI)
This commit is contained in:
parent
6819c8d847
commit
5e073233da
|
@ -12,4 +12,4 @@ data class Nodeinfo2_0(
|
|||
data class NodeinfoUsage(
|
||||
val users: Map<String, Long>,
|
||||
val localPosts: Long,
|
||||
)
|
||||
)
|
||||
|
|
|
@ -18,20 +18,25 @@ class NodeinfoApplicationService(
|
|||
private val applicationConfig: ApplicationConfig,
|
||||
transaction: Transaction,
|
||||
) : AbstractApplicationService<NodeinfoRequest, Nodeinfo2_0>(
|
||||
transaction, logger
|
||||
transaction,
|
||||
logger
|
||||
) {
|
||||
override suspend fun internalExecute(command: NodeinfoRequest, principal: Principal): Nodeinfo2_0 {
|
||||
return when (command.version) {
|
||||
"2.0", "2.1" -> Nodeinfo2_0(
|
||||
version = command.version,
|
||||
software = mapOf(
|
||||
"name" to "hideout", "version" to (buildInfo?.version ?: "UNKNOWN")
|
||||
"name" to "hideout",
|
||||
"version" to (buildInfo?.version ?: "UNKNOWN")
|
||||
),
|
||||
protocol = listOf("activitypub"),
|
||||
NodeinfoUsage(
|
||||
users = mapOf(
|
||||
"total" to 0, "activeMonth" to 0, "activeHalfyear" to 0
|
||||
), localPosts = 0
|
||||
"total" to 0,
|
||||
"activeMonth" to 0,
|
||||
"activeHalfyear" to 0
|
||||
),
|
||||
localPosts = 0
|
||||
),
|
||||
openRegistration = applicationConfig.private.not(),
|
||||
metadata = mapOf()
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
package dev.usbharu.hideout.activitypub.application.nodeinfo
|
||||
|
||||
data class NodeinfoRequest(val version: String)
|
||||
data class NodeinfoRequest(val version: String)
|
||||
|
|
|
@ -19,7 +19,8 @@ class NodeinfoController(
|
|||
Link(
|
||||
"http://nodeinfo.diaspora.software/ns/schema/2.1",
|
||||
href = applicationConfig.url.resolve("/nodeinfo/2.1").toString()
|
||||
), Link(
|
||||
),
|
||||
Link(
|
||||
"http://nodeinfo.diaspora.software/ns/schema/2.0",
|
||||
href = applicationConfig.url.resolve("/nodeinfo/2.0").toString()
|
||||
)
|
||||
|
@ -35,4 +36,4 @@ class NodeinfoController(
|
|||
suspend fun nodeinfo2_1(): Nodeinfo2_0 {
|
||||
return nodeinfoApplicationService.execute(NodeinfoRequest("2.1"), Anonymous)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue