Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
sjm
2024-07-15 14:23:18 +08:00
3 changed files with 21 additions and 12 deletions

View File

@@ -67,13 +67,16 @@ public class AliOssClient implements StandardOssClient {
return DataSizeUtil.format(x); return DataSizeUtil.format(x);
} }
public HashMap<String,String> selectAllBucket() { public List<HashMap<String,String>> selectAllBucket() {
List<Bucket> buckets = oss.listBuckets(); List<Bucket> buckets = oss.listBuckets();
HashMap<String,String> names = new HashMap<>(); List<HashMap<String,String>> list1 = new ArrayList<>();
buckets.forEach(bucket -> { 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(); 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++){ 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 * @author zlg
* @date: 2024/6/29 10:13 * @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(); List<Bucket> list = cosClient.listBuckets();
HashMap<String, String> names = new HashMap<>(); List<HashMap<String, String>> list1 = new ArrayList<>();
list.forEach(bucket -> { 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) { public String getTencentBucketSize(String bucket) {