diff --git a/spring/opengemini-spring-boot-starter-reactive/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiReactiveAutoConfiguration.java b/spring/opengemini-spring-boot-starter-reactive/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiReactiveAutoConfiguration.java index f6630356..f2f8512a 100644 --- a/spring/opengemini-spring-boot-starter-reactive/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiReactiveAutoConfiguration.java +++ b/spring/opengemini-spring-boot-starter-reactive/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiReactiveAutoConfiguration.java @@ -1,26 +1,29 @@ package io.opengemini.client.spring.data.config; import io.opengemini.client.spring.data.core.DefaultOpenGeminiSerializerFactory; +import io.opengemini.client.spring.data.core.OpenGeminiProperties; import io.opengemini.client.spring.data.core.OpenGeminiSerializerFactory; import io.opengemini.client.spring.data.core.ReactiveOpenGeminiTemplate; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import reactor.core.publisher.Flux; @AutoConfiguration @ConditionalOnClass({ReactiveOpenGeminiTemplate.class, Flux.class}) +@EnableConfigurationProperties(OpenGeminiProperties.class) public class OpenGeminiReactiveAutoConfiguration { @Bean - @ConditionalOnMissingBean(name = "reactiveOpenGeminiTemplate") + @ConditionalOnMissingBean(ReactiveOpenGeminiTemplate.class) public ReactiveOpenGeminiTemplate reactiveOpenGeminiTemplate() { return new ReactiveOpenGeminiTemplate(); } @Bean - @ConditionalOnMissingBean(name = "openGeminiSerializerFactory") + @ConditionalOnMissingBean(OpenGeminiSerializerFactory.class) public OpenGeminiSerializerFactory openGeminiSerializerFactory() { return new DefaultOpenGeminiSerializerFactory(); } diff --git a/spring/opengemini-spring-boot-starter/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiAutoConfiguration.java b/spring/opengemini-spring-boot-starter/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiAutoConfiguration.java index 4bd238a6..0b396f25 100644 --- a/spring/opengemini-spring-boot-starter/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiAutoConfiguration.java +++ b/spring/opengemini-spring-boot-starter/src/main/java/io/opengemini/client/spring/data/config/OpenGeminiAutoConfiguration.java @@ -19,21 +19,21 @@ public class OpenGeminiAutoConfiguration { @Bean - @ConditionalOnMissingBean(name = "openGeminiTemplate") + @ConditionalOnMissingBean(OpenGeminiTemplate.class) public OpenGeminiTemplate openGeminiTemplate(OpenGeminiAsyncClient openGeminiAsyncClient, OpenGeminiSerializerFactory openGeminiSerializerFactory) { return new OpenGeminiTemplate(openGeminiAsyncClient, openGeminiSerializerFactory); } @Bean - @ConditionalOnMissingBean(name = "openGeminiAsyncClient") + @ConditionalOnMissingBean(OpenGeminiAsyncClient.class) public OpenGeminiAsyncClient openGeminiAsyncClient(OpenGeminiProperties openGeminiProperties) throws OpenGeminiException { return OpenGeminiClientFactory.create(openGeminiProperties.toConfiguration()); } @Bean - @ConditionalOnMissingBean(name = "openGeminiSerializerFactory") + @ConditionalOnMissingBean(OpenGeminiSerializerFactory.class) public OpenGeminiSerializerFactory openGeminiSerializerFactory() { return new DefaultOpenGeminiSerializerFactory(); } diff --git a/spring/opengemini-spring/src/main/java/io/opengemini/client/spring/data/core/MeasurementOperations.java b/spring/opengemini-spring/src/main/java/io/opengemini/client/spring/data/core/MeasurementOperations.java index fe2975ba..765f7646 100644 --- a/spring/opengemini-spring/src/main/java/io/opengemini/client/spring/data/core/MeasurementOperations.java +++ b/spring/opengemini-spring/src/main/java/io/opengemini/client/spring/data/core/MeasurementOperations.java @@ -1,15 +1,14 @@ package io.opengemini.client.spring.data.core; -import io.opengemini.client.api.OpenGeminiException; import io.opengemini.client.api.Query; import java.util.List; public interface MeasurementOperations { - void write(T t) throws OpenGeminiException; + void write(T t); - void write(List list) throws OpenGeminiException; + void write(List list); List query(Query query); }