mirror of
https://github.com/dalbodeule/sh0rt.kr-pdns.git
synced 2025-06-08 10:48:20 +00:00
fix pdns api clients (retry 16x)
reflect-config.json add
This commit is contained in:
parent
9a406f1b3e
commit
bc537299e5
@ -81,7 +81,7 @@ tasks.withType<BootBuildImage> {
|
|||||||
|
|
||||||
environment = mapOf(
|
environment = mapOf(
|
||||||
"BP_NATIVE_IMAGE" to "true",
|
"BP_NATIVE_IMAGE" to "true",
|
||||||
"BP_NATIVE_IMAGE_BUILD_ARGUMENTS" to "-H:+UnlockExperimentalVMOptions -H:ReflectionConfigurationFiles=src/main/resources/reflect-config.json",
|
"BP_NATIVE_IMAGE_BUILD_ARGUMENTS" to "-H:+UnlockExperimentalVMOptions",
|
||||||
"BP_JVM_TYPE" to "JDK",
|
"BP_JVM_TYPE" to "JDK",
|
||||||
"BP_JVM_VERSION" to "21",
|
"BP_JVM_VERSION" to "21",
|
||||||
)
|
)
|
||||||
@ -100,6 +100,5 @@ tasks.named<org.springframework.boot.gradle.tasks.run.BootRun>("bootRun") {
|
|||||||
graalvmNative {
|
graalvmNative {
|
||||||
binaries.all {
|
binaries.all {
|
||||||
buildArgs.add("--initialize-at-build-time=org.slf4j.helpers")
|
buildArgs.add("--initialize-at-build-time=org.slf4j.helpers")
|
||||||
buildArgs.add("-H:ReflectionConfigurationFiles=src/main/resources/reflect-config.json")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
6
reflect-config.json
Normal file
6
reflect-config.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "java.lang.reflect.RecordComponent",
|
||||||
|
"allPublicMethods": true
|
||||||
|
}
|
||||||
|
]
|
@ -1,6 +1,7 @@
|
|||||||
package space.mori.dnsapi
|
package space.mori.dnsapi
|
||||||
|
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
@ -126,7 +127,11 @@ class PowerDNSAPIClient() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PowerDNSAPIError(val error: String, val errors: List<String>)
|
@ReflectiveAccess
|
||||||
|
data class PowerDNSAPIError(
|
||||||
|
@SerializedName("error") val error: String,
|
||||||
|
@SerializedName("errors") val errors: List<String>
|
||||||
|
)
|
||||||
class PowerDNSAPIException(private val error: PowerDNSAPIError): RuntimeException(error.error) {
|
class PowerDNSAPIException(private val error: PowerDNSAPIError): RuntimeException(error.error) {
|
||||||
val errors: List<String>
|
val errors: List<String>
|
||||||
get() = error.errors
|
get() = error.errors
|
||||||
|
5
src/main/kotlin/space/mori/dnsapi/ReflectiveAccess.kt
Normal file
5
src/main/kotlin/space/mori/dnsapi/ReflectiveAccess.kt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package space.mori.dnsapi
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.CLASS, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
annotation class ReflectiveAccess
|
@ -1,8 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "space.mori.dnsapi.PowerDNSAPIError",
|
|
||||||
"allDeclaredConstructors": true,
|
|
||||||
"allDeclaredFields": true,
|
|
||||||
"allDeclaredMethods": true
|
|
||||||
}
|
|
||||||
]
|
|
Loading…
x
Reference in New Issue
Block a user