tianboguang 2 gadi atpakaļ
vecāks
revīzija
0e07fe6ce3

+ 2 - 2
4dkankan-utils-fyun-oss/src/main/java/com/fdkankan/fyun/oss/config/OssConfig.java

@@ -4,12 +4,12 @@ import com.aliyun.oss.OSS;
 import com.aliyun.oss.OSSClientBuilder;
 import com.fdkankan.fyun.config.FYunFileConfig;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
 @Component
+@ConditionalOnProperty(name = "fyun.type", havingValue = "oss")
 public class OssConfig {
 
     @Autowired

+ 2 - 2
4dkankan-utils-fyun-s3/src/main/java/com/fdkankan/fyun/s3/config/S3Config.java

@@ -7,12 +7,12 @@ import com.amazonaws.services.s3.AmazonS3;
 import com.amazonaws.services.s3.AmazonS3ClientBuilder;
 import com.fdkankan.fyun.config.FYunFileConfig;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
 @Component
+@ConditionalOnProperty(name = "fyun.type",havingValue = "aws")
 public class S3Config {
 
     @Autowired