Compare commits
2 Commits
v0.1.0
...
feat/new-h
| Author | SHA1 | Date | |
|---|---|---|---|
| b41ea67b9b | |||
| 40168836b8 |
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "ai.neuon.utility"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import java.util.Properties
|
||||
import java.util.*
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.dokka)
|
||||
@@ -8,11 +8,15 @@ plugins {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://gitea.neuon-kuching.com/api/packages/neuon-ai/maven")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.ktor.client)
|
||||
testImplementation(kotlin("test"))
|
||||
implementation(libs.neuon.paging)
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package ai.neuon.utility.http.response
|
||||
|
||||
import io.ktor.http.*
|
||||
|
||||
/**
|
||||
* A runtime exception that can be used to stop a request immediately
|
||||
* with a specific status code.
|
||||
*/
|
||||
open class HttpResponseException(
|
||||
val status: HttpStatusCode,
|
||||
val statusMessage: String = status.description,
|
||||
cause: Throwable? = null,
|
||||
) : RuntimeException(cause)
|
||||
@@ -0,0 +1,8 @@
|
||||
package ai.neuon.utility.http.response
|
||||
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* A runtime exception that indicates a specific property is not found in a [Properties]
|
||||
*/
|
||||
class MissingPropertyException(key: String) : RuntimeException("Missing property `${key}`")
|
||||
@@ -0,0 +1,10 @@
|
||||
package ai.neuon.utility.http.response
|
||||
|
||||
import ai.neuon.utility.paging.PagingRequest
|
||||
import io.ktor.http.*
|
||||
|
||||
class UnsupportedPagingConfig(supportedTypes: List<PagingRequest.Type>) : HttpResponseException(
|
||||
status = HttpStatusCode.BadRequest,
|
||||
statusMessage = supportedTypes.distinct()
|
||||
.joinToString { it.key },
|
||||
)
|
||||
@@ -2,12 +2,14 @@
|
||||
dokka = "2.0.0"
|
||||
ktor = "3.2.0"
|
||||
kotlin = "2.2.0"
|
||||
neuon-paging = "0.2.0"
|
||||
|
||||
|
||||
[libraries]
|
||||
ktor-client = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
|
||||
neuon-paging = { module = "ai.neuon.utility:paging", version.ref = "neuon-paging" }
|
||||
|
||||
[plugins]
|
||||
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
ktor = { id = "io.ktor.plugin", version.ref = "ktor" }
|
||||
maven-publish = { id = "maven-publish" }
|
||||
|
||||
Reference in New Issue
Block a user