mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
document all endpoints (#350)
* Document all endpoints * Forgot about global endpoints
This commit is contained in:
@@ -7,22 +7,48 @@ package suwayomi.tachidesk.global.controller
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import io.javalin.http.Context
|
||||
import io.javalin.http.HttpCode
|
||||
import suwayomi.tachidesk.global.impl.About
|
||||
import suwayomi.tachidesk.global.impl.AboutDataClass
|
||||
import suwayomi.tachidesk.global.impl.AppUpdate
|
||||
import suwayomi.tachidesk.global.impl.UpdateDataClass
|
||||
import suwayomi.tachidesk.server.JavalinSetup.future
|
||||
import suwayomi.tachidesk.server.util.handler
|
||||
import suwayomi.tachidesk.server.util.withOperation
|
||||
|
||||
/** Settings Page/Screen */
|
||||
object SettingsController {
|
||||
/** returns some static info about the current app build */
|
||||
fun about(ctx: Context) {
|
||||
ctx.json(About.getAbout())
|
||||
}
|
||||
val about = handler(
|
||||
documentWith = {
|
||||
withOperation {
|
||||
summary("About Tachidesk")
|
||||
description("Returns some static info about the current app build")
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.json(About.getAbout())
|
||||
},
|
||||
withResults = {
|
||||
json<AboutDataClass>(HttpCode.OK)
|
||||
}
|
||||
)
|
||||
|
||||
/** check for app updates */
|
||||
fun checkUpdate(ctx: Context) {
|
||||
ctx.json(
|
||||
future { AppUpdate.checkUpdate() }
|
||||
)
|
||||
}
|
||||
val checkUpdate = handler(
|
||||
documentWith = {
|
||||
withOperation {
|
||||
summary("Tachidesk update check")
|
||||
description("Check for app updates")
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx ->
|
||||
ctx.json(
|
||||
future { AppUpdate.checkUpdate() }
|
||||
)
|
||||
},
|
||||
withResults = {
|
||||
json<UpdateDataClass>(HttpCode.OK)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user