mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Add a README.md with API documentation
Also fix some smaller issues found during writing the documentation
This commit is contained in:
@@ -7,6 +7,7 @@ import io.javalin.apibuilder.ApiBuilder.*
|
||||
import io.javalin.core.util.ContextUtil
|
||||
import io.javalin.core.util.Header
|
||||
import org.briarproject.briar.headless.blogs.BlogController
|
||||
import org.briarproject.briar.headless.contact.ContactController
|
||||
import org.briarproject.briar.headless.forums.ForumController
|
||||
import org.briarproject.briar.headless.messaging.MessagingController
|
||||
import java.lang.Runtime.getRuntime
|
||||
@@ -22,7 +23,7 @@ class Router @Inject
|
||||
constructor(
|
||||
private val briarService: BriarService,
|
||||
private val webSocketController: WebSocketController,
|
||||
private val contactController: MessagingController,
|
||||
private val contactController: ContactController,
|
||||
private val messagingController: MessagingController,
|
||||
private val forumController: ForumController,
|
||||
private val blogController: BlogController
|
||||
|
||||
@@ -28,7 +28,7 @@ constructor(
|
||||
val body = blogManager.getPostBody(header.id)
|
||||
header.output(body)
|
||||
}
|
||||
}
|
||||
}.sortedBy { it.timestampReceived }
|
||||
return ctx.json(posts)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import javax.annotation.concurrent.Immutable
|
||||
|
||||
@Immutable
|
||||
internal data class OutputContact(
|
||||
val id: Int,
|
||||
val contactId: Int,
|
||||
val author: OutputAuthor,
|
||||
val verified: Boolean
|
||||
) {
|
||||
internal constructor(c: Contact) : this(
|
||||
id = c.id.int,
|
||||
contactId = c.id.int,
|
||||
author = c.author.output(),
|
||||
verified = c.isVerified
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ constructor(
|
||||
header.output(contact.id, body)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.sortedBy { it.timestamp }
|
||||
return ctx.json(messages)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user