|
|
@@ -2,6 +2,7 @@ package cn.reghao.oss.store.service;
|
|
|
|
|
|
import cn.reghao.oss.store.api.dto.ObjectChannel;
|
|
|
import cn.reghao.oss.store.api.dto.StoreProperties;
|
|
|
+import cn.reghao.oss.store.config.SpringProperties;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
@@ -17,6 +18,11 @@ public class StoreLocalCache {
|
|
|
private StoreProperties storeProperties;
|
|
|
private final Map<String, ObjectChannel> prefixMap = new HashMap<>();
|
|
|
private final Map<Integer, ObjectChannel> channelIdMap = new HashMap<>();
|
|
|
+ private final SpringProperties springProperties;
|
|
|
+
|
|
|
+ public StoreLocalCache(SpringProperties springProperties) {
|
|
|
+ this.springProperties = springProperties;
|
|
|
+ }
|
|
|
|
|
|
public void initOssStore(StoreProperties storeProperties, List<ObjectChannel> list) {
|
|
|
this.storeProperties = storeProperties;
|
|
|
@@ -33,7 +39,7 @@ public class StoreLocalCache {
|
|
|
}
|
|
|
|
|
|
public String getHost() {
|
|
|
- return storeProperties != null ? storeProperties.getHost() : null;
|
|
|
+ return springProperties.getHost();
|
|
|
}
|
|
|
|
|
|
public String getDomain() {
|