Преглед изворни кода

添加公用endpoint站点配置

tianboguang пре 3 година
родитељ
комит
5cf6f01846

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

@@ -4,7 +4,6 @@ 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.annotation.Value;
 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Scope;
@@ -13,9 +12,6 @@ import org.springframework.stereotype.Component;
 @Component
 public class OssConfig {
 
-    @Value("${fyun.oss.endPoint}")
-    private String point;
-
     @Autowired
     private FYunFileConfig fYunFileConfig;
 
@@ -26,6 +22,6 @@ public class OssConfig {
     @Bean
     @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
     public OSS ossClient(){
-        return new OSSClientBuilder().build(point, fYunFileConfig.getKey(), fYunFileConfig.getSecret());
+        return new OSSClientBuilder().build(fYunFileConfig.getEndPoint(), fYunFileConfig.getKey(), fYunFileConfig.getSecret());
     }
 }

+ 7 - 0
4dkankan-utils-fyun-parent/src/main/java/com/fdkankan/fyun/config/FYunFileConfig.java

@@ -15,6 +15,9 @@ public class FYunFileConfig {
     @Value("${fyun.bucket}")
     private String bucket;
 
+    @Value("${fyun.endPoint}")
+    private String endPoint;
+
     public String getKey() {
         return key;
     }
@@ -26,4 +29,8 @@ public class FYunFileConfig {
     public String getBucket() {
         return bucket;
     }
+
+    public String getEndPoint() {
+        return endPoint;
+    }
 }