|
@@ -0,0 +1,53 @@
|
|
|
+/**
|
|
|
+ * DBSyncer Copyright 2020-2024 All Rights Reserved.
|
|
|
+ */
|
|
|
+package org.dbsyncer.sdk;
|
|
|
+
|
|
|
+import org.dbsyncer.common.util.StringUtil;
|
|
|
+import org.dbsyncer.sdk.model.ProductInfo;
|
|
|
+import org.dbsyncer.sdk.spi.LicenseService;
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
+import java.util.ServiceLoader;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author AE86
|
|
|
+ * @Version 1.0.0
|
|
|
+ * @Date 2024-07-05 00:30
|
|
|
+ */
|
|
|
+@Configuration
|
|
|
+public class SdkSupportConfiguration {
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ @ConditionalOnMissingBean
|
|
|
+ public LicenseService licenseService() {
|
|
|
+ ServiceLoader<LicenseService> services = ServiceLoader.load(LicenseService.class, Thread.currentThread().getContextClassLoader());
|
|
|
+ for (LicenseService s : services) {
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+ return new LicenseService() {
|
|
|
+ @Override
|
|
|
+ public String getLicensePath() {
|
|
|
+ return System.getProperty("user.dir") + File.separatorChar + "conf" + File.separatorChar;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getKey() {
|
|
|
+ return StringUtil.EMPTY;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ProductInfo getProductInfo() {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateLicense() {
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+}
|