From 56c6fef178618b095bab2f4592896181a04bb8c2 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 17 Aug 2023 02:02:19 +0200 Subject: [PATCH] Remove constructor binding --- .../twomartens/wahlrecht/configuration/ClockConfiguration.kt | 2 ++ .../de/twomartens/wahlrecht/property/ServiceProperties.kt | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/configuration/ClockConfiguration.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/configuration/ClockConfiguration.kt index 8aa2587..7ef1250 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/configuration/ClockConfiguration.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/configuration/ClockConfiguration.kt @@ -1,6 +1,7 @@ package de.twomartens.wahlrecht.configuration import de.twomartens.wahlrecht.property.ServiceProperties +import org.springframework.cloud.context.config.annotation.RefreshScope import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.time.Clock @@ -9,6 +10,7 @@ import java.time.Clock open class ClockConfiguration(private val serviceProperties: ServiceProperties) { @Bean + @RefreshScope open fun clock(): Clock { return Clock.system(serviceProperties.defaultTimeZone) } diff --git a/module-server/src/main/kotlin/de/twomartens/wahlrecht/property/ServiceProperties.kt b/module-server/src/main/kotlin/de/twomartens/wahlrecht/property/ServiceProperties.kt index 9f4825b..aa9dcb7 100644 --- a/module-server/src/main/kotlin/de/twomartens/wahlrecht/property/ServiceProperties.kt +++ b/module-server/src/main/kotlin/de/twomartens/wahlrecht/property/ServiceProperties.kt @@ -2,11 +2,10 @@ package de.twomartens.wahlrecht.property import io.swagger.v3.oas.annotations.media.Schema import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.bind.ConstructorBinding import org.springframework.cloud.context.config.annotation.RefreshScope import java.time.ZoneId @RefreshScope @ConfigurationProperties(prefix = "de.twomartens.wahlrecht") @Schema(description = "Properties, to configure this Application") -data class ServiceProperties @ConstructorBinding constructor(var defaultTimeZone: ZoneId, var greeting: String) +data class ServiceProperties(var defaultTimeZone: ZoneId, var greeting: String)