Manga database classes, api url change, fix source id

This commit is contained in:
Aria Moradi
2020-12-25 17:16:26 +03:30
parent 5597ad66b4
commit ab33a0ef1d
12 changed files with 105 additions and 22 deletions

View File

@@ -20,21 +20,32 @@ class Main {
ctx.header("Access-Control-Allow-Origin", "*") // allow the client which is running on another port
}
app.get("/api/v1/extensions") { ctx ->
app.get("/api/v1/extension/list") { ctx ->
ctx.json(getExtensionList())
}
app.get("/api/v1/extensions/install/:apkName") { ctx ->
app.get("/api/v1/extension/install/:apkName") { ctx ->
val apkName = ctx.pathParam("apkName")
println(apkName)
ctx.status(
installAPK(apkName)
)
}
app.get("/api/v1/sources/") { ctx ->
app.get("/api/v1/source/list") { ctx ->
ctx.json(getSourceList())
}
app.get("/api/v1/source/:source_id/popular") { ctx ->
val sourceId = ctx.pathParam("source_id")
ctx.json(getPopularManga(sourceId))
}
}
private fun getPopularManga(sourceId: String): List<Any> {
TODO("Not yet implemented")
}
}
}