|
@@ -11,6 +11,7 @@ import cn.hutool.core.util.URLUtil;
|
|
|
import cn.tr.core.utils.JsonUtils;
|
|
import cn.tr.core.utils.JsonUtils;
|
|
|
import cn.tr.module.api.sys.storage.StoragePojo;
|
|
import cn.tr.module.api.sys.storage.StoragePojo;
|
|
|
import cn.tr.module.sys.storage.dto.SysStorageConfigDTO;
|
|
import cn.tr.module.sys.storage.dto.SysStorageConfigDTO;
|
|
|
|
|
+import cn.tr.module.sys.storage.dto.SysStorageConfigQueryDTO;
|
|
|
import cn.tr.module.sys.storage.dto.SysStorageRecordDTO;
|
|
import cn.tr.module.sys.storage.dto.SysStorageRecordDTO;
|
|
|
import cn.tr.module.sys.storage.mapper.SysStorageRecordMapper;
|
|
import cn.tr.module.sys.storage.mapper.SysStorageRecordMapper;
|
|
|
import cn.tr.module.sys.storage.properties.TrStorageProperties;
|
|
import cn.tr.module.sys.storage.properties.TrStorageProperties;
|
|
@@ -29,7 +30,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
|
-import java.io.File;
|
|
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -67,6 +67,16 @@ public class StorageFileServiceImpl implements IStorageFileService {
|
|
|
defaultConfig=storageConfigService.selectDefault();
|
|
defaultConfig=storageConfigService.selectDefault();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void refreshConfig() {
|
|
|
|
|
+ SysStorageConfigQueryDTO query = new SysStorageConfigQueryDTO();
|
|
|
|
|
+ List<SysStorageConfigDTO> list = storageConfigService.selectSysStorageConfigList(query);
|
|
|
|
|
+ for (SysStorageConfigDTO storageConfig : list) {
|
|
|
|
|
+ fileClientFactory.createOrUpdateFileClient(storageConfig.getId(), storageConfig.getType(),parseClientConfig(storageConfig.getType(), storageConfig.getConfig()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public SysStorageRecordDTO upload(String configId,String cateId,String filename, byte[] content) throws Exception {
|
|
public SysStorageRecordDTO upload(String configId,String cateId,String filename, byte[] content) throws Exception {
|