Merge pull request 'dev' (#13) from dev into master

Reviewed-on: https://git.landaiqing.space/Schisandra-Cloud-Storage/schisandra-cloud-storage/pulls/13
This commit is contained in:
2024-07-15 23:09:33 +08:00
4 changed files with 26 additions and 12 deletions

View File

@@ -67,13 +67,16 @@ public class AliOssClient implements StandardOssClient {
return DataSizeUtil.format(x);
}
public HashMap<String,String> selectAllBucket() {
public List<HashMap<String,String>> selectAllBucket() {
List<Bucket> buckets = oss.listBuckets();
HashMap<String,String> names = new HashMap<>();
List<HashMap<String,String>> list1 = new ArrayList<>();
buckets.forEach(bucket -> {
names.put(bucket.getName(),getAliBucketSize(bucket.getName()));
HashMap<String, String> names = new HashMap<>();
names.put("name",bucket.getName());
names.put("size",getAliBucketSize(bucket.getName()));
list1.add(names);
});
return names;
return list1;
}
/**

View File

@@ -148,13 +148,16 @@ public class QiNiuOssClient implements StandardOssClient {
}
}
public HashMap<String, String> selectAllBucket() throws IOException{
public List<HashMap<String, String> >selectAllBucket() throws IOException{
String[] list = bucketManager.buckets();
HashMap<String, String> names = new HashMap<>();
List<HashMap<String, String>> list1 = new ArrayList<>();
for(int i=0;i<list.length;i++){
names.put(list[i],getQiniuBucketSize(list[i]));
HashMap<String, String> names = new HashMap<>();
names.put("name",list[i]);
names.put("size",getQiniuBucketSize(list[i]));
list1.add(names);
}
return names;
return list1;
}

View File

@@ -134,13 +134,16 @@ public class TencentOssClient implements StandardOssClient {
* @author zlg
* @date: 2024/6/29 10:13
*/
public HashMap<String, String> selectAllBucket() throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
public List<HashMap<String, String>> selectAllBucket() throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
List<Bucket> list = cosClient.listBuckets();
HashMap<String, String> names = new HashMap<>();
List<HashMap<String, String>> list1 = new ArrayList<>();
list.forEach(bucket -> {
names.put(bucket.getName(), getTencentBucketSize(bucket.getName()));
HashMap<String, String> names = new HashMap<>();
names.put("name",bucket.getName());
names.put("size",getTencentBucketSize(bucket.getName()));
list1.add(names);
});
return names;
return list1;
}
public String getTencentBucketSize(String bucket) {

View File

@@ -27,6 +27,11 @@ spring:
enabled: true
config:
enabled: true
#caffeine缓存
cache:
type: caffeine
caffeine:
spec: maximumSize=10000,expireAfterAccess=60s
# redis配置
redis:
# Redis数据库索引默认为0