diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index d67b8acc..b520cb40 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE blade-auth diff --git a/blade-common/pom.xml b/blade-common/pom.xml index 07c23eee..1a5ac418 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index 6062c57e..1c05bed9 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops-api/blade-flow-api/pom.xml b/blade-ops-api/blade-flow-api/pom.xml index a0556b30..3276df1e 100644 --- a/blade-ops-api/blade-flow-api/pom.xml +++ b/blade-ops-api/blade-flow-api/pom.xml @@ -5,7 +5,7 @@ blade-ops-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops-api/pom.xml b/blade-ops-api/pom.xml index c7f5f87d..ca0f44b7 100644 --- a/blade-ops-api/pom.xml +++ b/blade-ops-api/pom.xml @@ -5,13 +5,13 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 blade-ops-api ${project.artifactId} - 2.0.7.RELEASE + 2.1.0.RELEASE pom BladeX 微服务API集合 diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index 6e508de2..57b99b19 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index 0fbfe08b..123a9212 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-flow-design/pom.xml b/blade-ops/blade-flow-design/pom.xml index 7b9ca9d8..67a1fc7d 100644 --- a/blade-ops/blade-flow-design/pom.xml +++ b/blade-ops/blade-flow-design/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-flow/pom.xml b/blade-ops/blade-flow/pom.xml index c66b6960..1fecc7bb 100644 --- a/blade-ops/blade-flow/pom.xml +++ b/blade-ops/blade-flow/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-log/pom.xml b/blade-ops/blade-log/pom.xml index ef6e4ab5..77518fd2 100644 --- a/blade-ops/blade-log/pom.xml +++ b/blade-ops/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml index ceebe619..54844f72 100644 --- a/blade-ops/blade-resource/pom.xml +++ b/blade-ops/blade-resource/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/AliBuilder.java b/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/AliBuilder.java new file mode 100644 index 00000000..1fda1521 --- /dev/null +++ b/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/AliBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.resource.builder; + +import com.aliyun.oss.ClientConfiguration; +import com.aliyun.oss.OSSClient; +import com.aliyun.oss.common.auth.CredentialsProvider; +import com.aliyun.oss.common.auth.DefaultCredentialProvider; +import lombok.SneakyThrows; +import org.springblade.core.alioss.AliossTemplate; +import org.springblade.core.oss.OssTemplate; +import org.springblade.core.oss.props.OssProperties; +import org.springblade.core.oss.rule.OssRule; +import org.springblade.resource.entity.Oss; + +/** + * QiniuBuilder + * + * @author Chill + */ +public class AliBuilder { + + @SneakyThrows + public static OssTemplate template(Oss oss, OssRule ossRule) { + // 创建ClientConfiguration。ClientConfiguration是OSSClient的配置类,可配置代理、连接超时、最大连接数等参数。 + ClientConfiguration conf = new ClientConfiguration(); + // 设置OSSClient允许打开的最大HTTP连接数,默认为1024个。 + conf.setMaxConnections(1024); + // 设置Socket层传输数据的超时时间,默认为50000毫秒。 + conf.setSocketTimeout(50000); + // 设置建立连接的超时时间,默认为50000毫秒。 + conf.setConnectionTimeout(50000); + // 设置从连接池中获取连接的超时时间(单位:毫秒),默认不超时。 + conf.setConnectionRequestTimeout(1000); + // 设置连接空闲超时时间。超时则关闭连接,默认为60000毫秒。 + conf.setIdleConnectionTime(60000); + // 设置失败请求重试次数,默认为3次。 + conf.setMaxErrorRetry(5); + OssProperties ossProperties = new OssProperties(); + ossProperties.setEndpoint(oss.getEndpoint()); + ossProperties.setAccessKey(oss.getAccessKey()); + ossProperties.setSecretKey(oss.getSecretKey()); + ossProperties.setBucketName(oss.getBucketName()); + CredentialsProvider credentialsProvider = new DefaultCredentialProvider(ossProperties.getAccessKey(), ossProperties.getSecretKey()); + OSSClient ossClient = new OSSClient(ossProperties.getEndpoint(), credentialsProvider, conf); + return new AliossTemplate(ossClient, ossProperties, ossRule); + } + +} diff --git a/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java b/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java index 3f8ff0ce..b511f37e 100644 --- a/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java +++ b/blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/OssBuilder.java @@ -87,6 +87,8 @@ public class OssBuilder { template = MinioBuilder.template(oss, ossRule); } else if (oss.getCategory() == OssEnum.QINIU.getCategory()) { template = QiniuBuilder.template(oss, ossRule); + } else if (oss.getCategory() == OssEnum.ALI.getCategory()) { + template = AliBuilder.template(oss, ossRule); } templatePool.put(tenantId, template); ossPool.put(tenantId, oss); diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index c681a0c5..5ac6e55d 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,13 +5,13 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 blade-ops ${project.artifactId} - 2.0.7.RELEASE + 2.1.0.RELEASE pom diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index 4c1924ed..46fff5a0 100644 --- a/blade-service-api/blade-desk-api/pom.xml +++ b/blade-service-api/blade-desk-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index 21574aac..b7f0de69 100644 --- a/blade-service-api/blade-dict-api/pom.xml +++ b/blade-service-api/blade-dict-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service-api/blade-scope-api/pom.xml b/blade-service-api/blade-scope-api/pom.xml index 05c805ca..23f8d527 100644 --- a/blade-service-api/blade-scope-api/pom.xml +++ b/blade-service-api/blade-scope-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index 9c9f5fb2..8391bcf1 100644 --- a/blade-service-api/blade-system-api/pom.xml +++ b/blade-service-api/blade-system-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index 41f57b53..6d3378d5 100644 --- a/blade-service-api/blade-user-api/pom.xml +++ b/blade-service-api/blade-user-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index 7a541fca..5169d5e4 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ BladeX org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 blade-service-api ${project.artifactId} - 2.0.7.RELEASE + 2.1.0.RELEASE pom BladeX 微服务API集合 diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index 4332925a..f1a593af 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index 81c230c2..fad1155a 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index 15d35fb1..a2a497b4 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 3bad7b85..fb795b1e 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -6,14 +6,14 @@ org.springblade BladeX - 2.0.7.RELEASE + 2.1.0.RELEASE 4.0.0 blade-service ${project.artifactId} - 2.0.7.RELEASE + 2.1.0.RELEASE pom BladeX 微服务集合 diff --git a/doc/sql/update/mysql-update-2.0.7~2.0.8.sql b/doc/sql/update/mysql-update-2.0.7~2.0.8.sql index 081e89bc..7855dfe5 100644 --- a/doc/sql/update/mysql-update-2.0.7~2.0.8.sql +++ b/doc/sql/update/mysql-update-2.0.7~2.0.8.sql @@ -14,3 +14,12 @@ INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) VALUES ('1161272593873322996', '1164733121140551682', '1123598816738675201'); INSERT INTO `blade_role_menu`(`id`,`menu_id`,`role_id`) VALUES ('1161272593873322997', '1164733349637844993', '1123598816738675201'); + +-- ---------------------------- +-- 重新配置oss字典 +-- ---------------------------- +DELETE FROM `blade_dict` WHERE CODE = 'oss'; +INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738676224, 0, 'oss', -1, '对象存储类型', 6, NULL, 0); +INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738676225, 1123598814738676224, 'oss', 1, 'minio', 1, NULL, 0); +INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738676226, 1123598814738676224, 'oss', 2, 'qiniu', 2, NULL, 0); +INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738676227, 1123598814738676224, 'oss', 3, 'qiniu', 3, NULL, 0); diff --git a/doc/sql/update/oracle-update-2.0.7~2.0.8.sql b/doc/sql/update/oracle-update-2.0.7~2.0.8.sql index 0e2dae07..dfa2495a 100644 --- a/doc/sql/update/oracle-update-2.0.7~2.0.8.sql +++ b/doc/sql/update/oracle-update-2.0.7~2.0.8.sql @@ -15,3 +15,11 @@ VALUES ('1161272593873322996', '1164733121140551682', '1123598816738675201'); INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID) VALUES ('1161272593873322997', '1164733349637844993', '1123598816738675201'); +-- ---------------------------- +-- 重新配置oss字典 +-- ---------------------------- +DELETE FROM "BLADEX"."BLADE_DICT" WHERE CODE = 'oss'; +INSERT INTO "BLADEX"."BLADE_DICT"(ID, PARENT_ID, CODE, DICT_KEY, DICT_VALUE, SORT, REMARK, IS_DELETED) VALUES (1123598814738676224, 0, 'oss', -1, '对象存储类型', 6, NULL, 0); +INSERT INTO "BLADEX"."BLADE_DICT"(ID, PARENT_ID, CODE, DICT_KEY, DICT_VALUE, SORT, REMARK, IS_DELETED) VALUES (1123598814738676225, 1123598814738676224, 'oss', 1, 'minio', 1, NULL, 0); +INSERT INTO "BLADEX"."BLADE_DICT"(ID, PARENT_ID, CODE, DICT_KEY, DICT_VALUE, SORT, REMARK, IS_DELETED) VALUES (1123598814738676226, 1123598814738676224, 'oss', 2, 'qiniu', 2, NULL, 0); +INSERT INTO "BLADEX"."BLADE_DICT"(ID, PARENT_ID, CODE, DICT_KEY, DICT_VALUE, SORT, REMARK, IS_DELETED) VALUES (1123598814738676227, 1123598814738676224, 'oss', 3, 'qiniu', 3, NULL, 0); diff --git a/doc/sql/update/postgresql-update-2.0.7~2.0.8.sql b/doc/sql/update/postgresql-update-2.0.7~2.0.8.sql index 9c0eed7a..82a7d17f 100644 --- a/doc/sql/update/postgresql-update-2.0.7~2.0.8.sql +++ b/doc/sql/update/postgresql-update-2.0.7~2.0.8.sql @@ -14,3 +14,12 @@ INSERT INTO "blade_role_menu"("id","menu_id","role_id") VALUES ('1161272593873322996', '1164733121140551682', '1123598816738675201'); INSERT INTO "blade_role_menu"("id","menu_id","role_id") VALUES ('1161272593873322997', '1164733349637844993', '1123598816738675201'); + +-- ---------------------------- +-- 重新配置oss字典 +-- ---------------------------- +DELETE FROM "blade_dict" WHERE CODE = 'oss'; +INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_deleted") VALUES (1123598814738676224, 0, 'oss', -1, '对象存储类型', 6, NULL, 0); +INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_deleted") VALUES (1123598814738676225, 1123598814738676224, 'oss', 1, 'minio', 1, NULL, 0); +INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_deleted") VALUES (1123598814738676226, 1123598814738676224, 'oss', 2, 'qiniu', 2, NULL, 0); +INSERT INTO "blade_dict"("id", "parent_id", "code", "dict_key", "dict_value", "sort", "remark", "is_deleted") VALUES (1123598814738676227, 1123598814738676224, 'oss', 3, 'qiniu', 3, NULL, 0); diff --git a/pom.xml b/pom.xml index 639dada8..7f33cfc4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.springblade BladeX - 2.0.7.RELEASE + 2.1.0.RELEASE pom - 2.0.7.RELEASE - 2.0.7.RELEASE + 2.1.0.RELEASE + 2.1.0.RELEASE 1.8 3.8.1 diff --git a/script/docker/.env b/script/docker/.env index 1a47e057..8488464f 100644 --- a/script/docker/.env +++ b/script/docker/.env @@ -1,2 +1,2 @@ REGISTER=192.168.0.157/blade -TAG=2.0.7.RELEASE +TAG=2.1.0.RELEASE