diff --git a/mall-member/member-api/pom.xml b/mall-member/member-api/pom.xml
index 547ab9660..9a3488d56 100644
--- a/mall-member/member-api/pom.xml
+++ b/mall-member/member-api/pom.xml
@@ -12,27 +12,19 @@
member-api
-
- com.youlai
- common-core
-
-
-
- com.baomidou
- mybatis-plus-spring-boot3-starter
- true
-
-
org.springframework.cloud
spring-cloud-starter-openfeign
+
+ com.youlai
+ common-core
+
com.youlai
common-web
true
-
diff --git a/mall-member/member-boot/pom.xml b/mall-member/member-boot/pom.xml
index 85d5ef99c..a03dc9df3 100644
--- a/mall-member/member-boot/pom.xml
+++ b/mall-member/member-boot/pom.xml
@@ -48,11 +48,6 @@
spring-cloud-starter-alibaba-nacos-config
-
- com.youlai
- common-mybatis
-
-
com.youlai
common-web
@@ -60,7 +55,7 @@
com.youlai
- common-redis
+ common-mybatis
@@ -70,12 +65,17 @@
com.youlai
- common-seata
+ common-middleware-redis
com.youlai
- common-rabbitmq
+ common-middleware-seata
+
+
+
+ com.youlai
+ common-middleware-rabbitmq
diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java
index a0932a7fd..189b4b254 100644
--- a/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java
+++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java
@@ -6,9 +6,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
+/**
+ * 会员服务启动类
+ *
+ * @author ray
+ */
@SpringBootApplication
@EnableDiscoveryClient()
-@EnableFeignClients(basePackageClasses = { SkuFeignClient.class})
+@EnableFeignClients(basePackageClasses = {SkuFeignClient.class})
public class MemberApplication {
public static void main(String[] args) {
SpringApplication.run(MemberApplication.class, args);
diff --git a/mall-order/order-boot/pom.xml b/mall-order/order-boot/pom.xml
index 55a9e5144..69bc5c59a 100644
--- a/mall-order/order-boot/pom.xml
+++ b/mall-order/order-boot/pom.xml
@@ -73,16 +73,6 @@
common-web
-
- com.youlai
- common-redis
-
-
-
- com.youlai
- common-rabbitmq
-
-
com.youlai
common-security
@@ -90,7 +80,12 @@
com.youlai
- common-seata
+ common-middleware-redis
+
+
+
+ com.youlai
+ common-middleware-seata
diff --git a/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java b/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java
index 4fe658207..f4beaaa49 100644
--- a/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java
+++ b/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java
@@ -7,9 +7,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
+/**
+ * 订单服务启动类
+ *
+ * @author ray
+ */
@SpringBootApplication
@EnableDiscoveryClient
-@EnableFeignClients(basePackageClasses = { MemberFeignClient.class, SkuFeignClient.class})
+@EnableFeignClients(basePackageClasses = {MemberFeignClient.class, SkuFeignClient.class})
public class OrderApplication {
public static void main(String[] args) {
diff --git a/mall-product/product-api/pom.xml b/mall-product/product-api/pom.xml
index 8a3dd0934..40c38dbb2 100644
--- a/mall-product/product-api/pom.xml
+++ b/mall-product/product-api/pom.xml
@@ -24,12 +24,6 @@
true
-
- com.baomidou
- mybatis-plus-spring-boot3-starter
- true
-
-
org.springframework.cloud
spring-cloud-starter-openfeign
diff --git a/mall-product/product-boot/pom.xml b/mall-product/product-boot/pom.xml
index 72affd82d..8f2e87532 100644
--- a/mall-product/product-boot/pom.xml
+++ b/mall-product/product-boot/pom.xml
@@ -62,11 +62,6 @@
member-api
-
- com.youlai
- common-mybatis
-
-
com.youlai
common-web
@@ -74,12 +69,7 @@
com.youlai
- common-redis
-
-
-
- com.youlai
- common-rabbitmq
+ common-mybatis
@@ -89,7 +79,17 @@
com.youlai
- common-seata
+ common-middleware-redis
+
+
+
+ com.youlai
+ common-middleware-rabbitmq
+
+
+
+ com.youlai
+ common-middleware-seata
diff --git a/mall-sales/sales-boot/pom.xml b/mall-sales/sales-boot/pom.xml
index 8544cad53..b349d02ff 100644
--- a/mall-sales/sales-boot/pom.xml
+++ b/mall-sales/sales-boot/pom.xml
@@ -68,11 +68,6 @@
common-web
-
- com.youlai
- common-redis
-
-
com.youlai
common-security
diff --git a/mall-sales/sales-boot/src/main/java/com/youlai/mall/sms/SalesApplication.java b/mall-sales/sales-boot/src/main/java/com/youlai/mall/sms/SalesApplication.java
index 47d69c39a..9af7c077c 100644
--- a/mall-sales/sales-boot/src/main/java/com/youlai/mall/sms/SalesApplication.java
+++ b/mall-sales/sales-boot/src/main/java/com/youlai/mall/sms/SalesApplication.java
@@ -7,10 +7,9 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
- * 优惠营销系统
- * 秒杀功能开发
- * 1、管理员端开发秒杀活动管理界面(创建秒杀活动场次,建立秒杀活动场次与商品关联)
- * 2、秒杀预热。采用 异步+定时 将秒杀数据提前同步到redis中
+ * 营销服务启动类
+ *
+ * @author ray
*/
@SpringBootApplication
@EnableDiscoveryClient
diff --git a/pom.xml b/pom.xml
index 289c03dd0..818207590 100644
--- a/pom.xml
+++ b/pom.xml
@@ -164,24 +164,6 @@
${project.version}
-
- com.youlai
- common-mybatis
- ${project.version}
-
-
-
- com.youlai
- common-rabbitmq
- ${project.version}
-
-
-
- com.youlai
- common-redis
- ${project.version}
-
-
com.youlai
common-web
@@ -196,13 +178,37 @@
com.youlai
- common-seata
+ common-mybatis
${project.version}
com.youlai
- common-sms
+ common-middleware-rabbitmq
+ ${project.version}
+
+
+
+ com.youlai
+ common-middleware-redis
+ ${project.version}
+
+
+
+ com.youlai
+ common-middleware-seata
+ ${project.version}
+
+
+
+ com.youlai
+ common-thirdparty-sms
+ ${project.version}
+
+
+
+ com.youlai
+ common-thirdparty-oss
${project.version}
diff --git a/youlai-auth/pom.xml b/youlai-auth/pom.xml
index 31abb4767..198728936 100644
--- a/youlai-auth/pom.xml
+++ b/youlai-auth/pom.xml
@@ -48,6 +48,17 @@
spring-cloud-starter-loadbalancer
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ com.github.binarywang
+ weixin-java-miniapp
+
+
com.youlai
member-api
@@ -58,11 +69,6 @@
system-api
-
- com.youlai
- common-web
-
-
com.youlai
common-core
@@ -70,12 +76,7 @@
com.youlai
- common-redis
-
-
-
- com.github.binarywang
- weixin-java-miniapp
+ common-web
@@ -85,13 +86,12 @@
com.youlai
- common-sms
+ common-middleware-redis
- org.springframework.boot
- spring-boot-starter-test
- test
+ com.youlai
+ common-thirdparty-sms
diff --git a/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java b/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java
index 434db2ed8..6b05c7581 100644
--- a/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java
+++ b/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java
@@ -7,6 +7,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
+/**
+ * 认证服务启动类
+ *
+ * @author ray
+ */
@EnableFeignClients(basePackageClasses = {UserFeignClient.class, MemberFeignClient.class})
@SpringBootApplication
@EnableDiscoveryClient
diff --git a/youlai-common/common-rabbitmq/pom.xml b/youlai-common/common-middleware/common-middleware-rabbitmq/pom.xml
similarity index 63%
rename from youlai-common/common-rabbitmq/pom.xml
rename to youlai-common/common-middleware/common-middleware-rabbitmq/pom.xml
index 0406837bf..edb491c66 100644
--- a/youlai-common/common-rabbitmq/pom.xml
+++ b/youlai-common/common-middleware/common-middleware-rabbitmq/pom.xml
@@ -2,14 +2,20 @@
+ 4.0.0
- youlai-common
com.youlai
+ common-middleware
3.2.1
- 4.0.0
- common-rabbitmq
+ common-middleware-rabbitmq
+
+
+ 17
+ 17
+ UTF-8
+
@@ -18,4 +24,4 @@
-
+
\ No newline at end of file
diff --git a/youlai-common/common-rabbitmq/src/main/java/com/youlai/common/rabbitmq/config/RabbitConfig.java b/youlai-common/common-middleware/common-middleware-rabbitmq/src/main/java/com/youlai/common/rabbitmq/config/RabbitConfig.java
similarity index 100%
rename from youlai-common/common-rabbitmq/src/main/java/com/youlai/common/rabbitmq/config/RabbitConfig.java
rename to youlai-common/common-middleware/common-middleware-rabbitmq/src/main/java/com/youlai/common/rabbitmq/config/RabbitConfig.java
diff --git a/youlai-common/common-rabbitmq/src/main/java/com/youlai/common/rabbitmq/constant/RabbitMqConstants.java b/youlai-common/common-middleware/common-middleware-rabbitmq/src/main/java/com/youlai/common/rabbitmq/constant/RabbitMqConstants.java
similarity index 100%
rename from youlai-common/common-rabbitmq/src/main/java/com/youlai/common/rabbitmq/constant/RabbitMqConstants.java
rename to youlai-common/common-middleware/common-middleware-rabbitmq/src/main/java/com/youlai/common/rabbitmq/constant/RabbitMqConstants.java
diff --git a/youlai-common/common-rabbitmq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/youlai-common/common-middleware/common-middleware-rabbitmq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 100%
rename from youlai-common/common-rabbitmq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
rename to youlai-common/common-middleware/common-middleware-rabbitmq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
diff --git a/youlai-common/common-redis/pom.xml b/youlai-common/common-middleware/common-middleware-redis/pom.xml
similarity index 81%
rename from youlai-common/common-redis/pom.xml
rename to youlai-common/common-middleware/common-middleware-redis/pom.xml
index 6a3e8560a..72b662932 100644
--- a/youlai-common/common-redis/pom.xml
+++ b/youlai-common/common-middleware/common-middleware-redis/pom.xml
@@ -2,14 +2,20 @@
+ 4.0.0
- youlai-common
com.youlai
+ common-middleware
3.2.1
- 4.0.0
- common-redis
+ common-middleware-redis
+
+
+ 17
+ 17
+ UTF-8
+
@@ -27,7 +33,7 @@
spring-boot-starter-cache
-
+
org.apache.commons
commons-pool2
@@ -50,4 +56,5 @@
-
+
+
\ No newline at end of file
diff --git a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisCacheConfig.java b/youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisCacheConfig.java
similarity index 98%
rename from youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisCacheConfig.java
rename to youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisCacheConfig.java
index b6cf1b575..01c15a057 100644
--- a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisCacheConfig.java
+++ b/youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisCacheConfig.java
@@ -1,4 +1,4 @@
-package com.youlai.common.redis;
+package com.youlai.common.redis.config;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
diff --git a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisConfig.java b/youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisConfig.java
similarity index 96%
rename from youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisConfig.java
rename to youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisConfig.java
index 9cbccba5e..5163bd8a3 100644
--- a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/RedisConfig.java
+++ b/youlai-common/common-middleware/common-middleware-redis/src/main/java/com/youlai/common/redis/config/RedisConfig.java
@@ -1,4 +1,4 @@
-package com.youlai.common.redis;
+package com.youlai.common.redis.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/youlai-common/common-middleware/common-middleware-redis/src/main/resources/META-INF.spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/youlai-common/common-middleware/common-middleware-redis/src/main/resources/META-INF.spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..b8febee64
--- /dev/null
+++ b/youlai-common/common-middleware/common-middleware-redis/src/main/resources/META-INF.spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1,2 @@
+com.youlai.common.redis.config.RedisCacheConfig
+com.youlai.common.redis.config.RedisConfig
diff --git a/youlai-common/common-seata/pom.xml b/youlai-common/common-middleware/common-middleware-seata/pom.xml
similarity index 90%
rename from youlai-common/common-seata/pom.xml
rename to youlai-common/common-middleware/common-middleware-seata/pom.xml
index 8082fdea5..85a97e471 100644
--- a/youlai-common/common-seata/pom.xml
+++ b/youlai-common/common-middleware/common-middleware-seata/pom.xml
@@ -2,14 +2,14 @@
+ 4.0.0
- youlai-common
com.youlai
+ common-middleware
3.2.1
- 4.0.0
- common-seata
+ common-middleware-seata
17
@@ -29,4 +29,5 @@
+
\ No newline at end of file
diff --git a/youlai-common/common-middleware/pom.xml b/youlai-common/common-middleware/pom.xml
new file mode 100644
index 000000000..e5fe29c21
--- /dev/null
+++ b/youlai-common/common-middleware/pom.xml
@@ -0,0 +1,26 @@
+
+
+ 4.0.0
+
+ com.youlai
+ youlai-common
+ 3.2.1
+
+
+ common-middleware
+ pom
+
+ common-middleware-redis
+ common-middleware-seata
+ common-middleware-rabbitmq
+
+
+
+ 17
+ 17
+ UTF-8
+
+
+
\ No newline at end of file
diff --git a/youlai-common/common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/youlai-common/common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted file mode 100644
index b63aa8d5b..000000000
--- a/youlai-common/common-redis/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ /dev/null
@@ -1,2 +0,0 @@
-com.youlai.common.redis.RedisCacheConfig
-com.youlai.common.redis.RedisConfig
diff --git a/youlai-common/common-security/pom.xml b/youlai-common/common-security/pom.xml
index 0acc2cdbf..8b4148809 100644
--- a/youlai-common/common-security/pom.xml
+++ b/youlai-common/common-security/pom.xml
@@ -30,7 +30,8 @@
com.youlai
- common-redis
+ common-middleware-redis
+ true
diff --git a/youlai-common/common-thirdparty/common-thirdparty-oss/pom.xml b/youlai-common/common-thirdparty/common-thirdparty-oss/pom.xml
new file mode 100644
index 000000000..79cc4d6bc
--- /dev/null
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/pom.xml
@@ -0,0 +1,45 @@
+
+
+ 4.0.0
+
+ com.youlai
+ common-thirdparty
+ 3.2.1
+
+
+ common-thirdparty-oss
+
+
+ 17
+ 17
+ UTF-8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ true
+
+
+
+
+ io.minio
+ minio
+
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+
+
+
+ io.swagger.core.v3
+ swagger-annotations
+
+
+
+
+
\ No newline at end of file
diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/model/vo/FileInfo.java b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/model/FileInfo.java
similarity index 74%
rename from youlai-system/system-boot/src/main/java/com/youlai/system/model/vo/FileInfo.java
rename to youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/model/FileInfo.java
index 8cfd6d5c3..6b8535bd3 100644
--- a/youlai-system/system-boot/src/main/java/com/youlai/system/model/vo/FileInfo.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/model/FileInfo.java
@@ -1,8 +1,15 @@
-package com.youlai.system.model.vo;
+package com.youlai.common.oss.model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
+
+/**
+ * 文件对象
+ *
+ * @author ray
+ * @since 1.0.0
+ */
@Schema(description = "文件对象")
@Data
public class FileInfo {
diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/service/OssService.java b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/OssService.java
similarity index 84%
rename from youlai-system/system-boot/src/main/java/com/youlai/system/service/OssService.java
rename to youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/OssService.java
index 86e846c73..529cb6c01 100644
--- a/youlai-system/system-boot/src/main/java/com/youlai/system/service/OssService.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/OssService.java
@@ -1,6 +1,7 @@
-package com.youlai.system.service;
+package com.youlai.common.oss.service;
-import com.youlai.system.model.vo.FileInfo;
+
+import com.youlai.common.oss.model.FileInfo;
import org.springframework.web.multipart.MultipartFile;
/**
diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/AliyunOssService.java b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/AliyunOssService.java
similarity index 93%
rename from youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/AliyunOssService.java
rename to youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/AliyunOssService.java
index f70c22bf8..0acf66515 100644
--- a/youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/AliyunOssService.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/AliyunOssService.java
@@ -1,4 +1,4 @@
-package com.youlai.system.service.impl.oss;
+package com.youlai.common.oss.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
@@ -8,8 +8,8 @@ import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.ObjectMetadata;
import com.aliyun.oss.model.PutObjectRequest;
-import com.youlai.system.model.vo.FileInfo;
-import com.youlai.system.service.OssService;
+import com.youlai.common.oss.model.FileInfo;
+import com.youlai.common.oss.service.OssService;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@@ -90,8 +90,10 @@ public class AliyunOssService implements OssService {
@Override
public boolean deleteFile(String filePath) {
Assert.notBlank(filePath, "删除文件路径不能为空");
- String fileHost = "https://" + bucketName + "." + endpoint; // 文件主机域名
- String fileName = filePath.substring(fileHost.length() + 1); // +1 是/占一个字符,截断左闭右开
+ // 文件主机域名
+ String fileHost = "https://" + bucketName + "." + endpoint;
+ // +1 是/占一个字符,截断左闭右开
+ String fileName = filePath.substring(fileHost.length() + 1);
aliyunOssClient.deleteObject(bucketName, fileName);
return true;
}
diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/MinioOssService.java b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/MinioOssService.java
similarity index 94%
rename from youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/MinioOssService.java
rename to youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/MinioOssService.java
index ecdb657b2..d1ba2a1a7 100644
--- a/youlai-system/system-boot/src/main/java/com/youlai/system/service/impl/oss/MinioOssService.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/java/com/youlai/common/oss/service/impl/MinioOssService.java
@@ -1,12 +1,12 @@
-package com.youlai.system.service.impl.oss;
+package com.youlai.common.oss.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
-import com.youlai.system.model.vo.FileInfo;
-import com.youlai.system.service.OssService;
+import com.youlai.common.oss.model.FileInfo;
+import com.youlai.common.oss.service.OssService;
import io.minio.*;
import io.minio.errors.*;
import io.minio.http.Method;
@@ -132,8 +132,8 @@ public class MinioOssService implements OssService {
try {
String fileName;
if (StrUtil.isNotBlank(customDomain)) {
- // https://oss.youlai.tech/default/20221120/test.jpg → 20221120/test.jpg
- fileName = filePath.substring(customDomain.length() + 1 + bucketName.length() + 1); // 两个/占了2个字符长度
+ // https://oss.youlai.tech/default/20221120/test.jpg → 20221120/test.jpg // 两个/占了2个字符长度
+ fileName = filePath.substring(customDomain.length() + 1 + bucketName.length() + 1);
} else {
// http://localhost:9000/default/20221120/test.jpg → 20221120/test.jpg
fileName = filePath.substring(endpoint.length() + 1 + bucketName.length() + 1);
@@ -156,17 +156,15 @@ public class MinioOssService implements OssService {
/**
* PUBLIC桶策略
* 如果不配置,则新建的存储桶默认是PRIVATE,则存储桶文件会拒绝访问 Access Denied
+ * AWS的S3存储桶策略
+ * Principal: 生效用户对象
+ * Resource: 指定存储桶
+ * Action: 操作行为
*
* @param bucketName
* @return
*/
private static String publicBucketPolicy(String bucketName) {
- /**
- * AWS的S3存储桶策略
- * Principal: 生效用户对象
- * Resource: 指定存储桶
- * Action: 操作行为
- */
return "{\"Version\":\"2012-10-17\","
+ "\"Statement\":[{\"Effect\":\"Allow\","
@@ -181,7 +179,7 @@ public class MinioOssService implements OssService {
/**
* 创建存储桶(存储桶不存在)
*
- * @param bucketName
+ * @param bucketName 存储桶名称
*/
@SneakyThrows
private void createBucketIfAbsent(String bucketName) {
diff --git a/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..3c95b4097
--- /dev/null
+++ b/youlai-common/common-thirdparty/common-thirdparty-oss/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1,2 @@
+ com.youlai.common.oss.service.impl.AliyunOssService
+ com.youlai.common.oss.service.impl.MinioOssService
diff --git a/youlai-common/common-sms/pom.xml b/youlai-common/common-thirdparty/common-thirdparty-sms/pom.xml
similarity index 88%
rename from youlai-common/common-sms/pom.xml
rename to youlai-common/common-thirdparty/common-thirdparty-sms/pom.xml
index a3dec9804..994cf25a1 100644
--- a/youlai-common/common-sms/pom.xml
+++ b/youlai-common/common-thirdparty/common-thirdparty-sms/pom.xml
@@ -2,20 +2,21 @@
+ 4.0.0
- youlai-common
com.youlai
+ common-thirdparty
3.2.1
- 4.0.0
- common-sms
+ common-thirdparty-sms
17
17
UTF-8
+
com.youlai
@@ -25,7 +26,7 @@
com.youlai
- common-redis
+ common-middleware-redis
true
@@ -42,5 +43,4 @@
-
\ No newline at end of file
diff --git a/youlai-common/common-sms/src/main/java/com/youlai/common/sms/property/AliyunSmsProperties.java b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/config/AliyunSmsProperties.java
similarity index 96%
rename from youlai-common/common-sms/src/main/java/com/youlai/common/sms/property/AliyunSmsProperties.java
rename to youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/config/AliyunSmsProperties.java
index cf80b5e7d..7d827f3df 100644
--- a/youlai-common/common-sms/src/main/java/com/youlai/common/sms/property/AliyunSmsProperties.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/config/AliyunSmsProperties.java
@@ -1,4 +1,4 @@
-package com.youlai.common.sms.property;
+package com.youlai.common.sms.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
diff --git a/youlai-common/common-sms/src/main/java/com/youlai/common/sms/service/SmsService.java b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/service/SmsService.java
similarity index 100%
rename from youlai-common/common-sms/src/main/java/com/youlai/common/sms/service/SmsService.java
rename to youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/service/SmsService.java
diff --git a/youlai-common/common-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java
similarity index 97%
rename from youlai-common/common-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java
rename to youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java
index fbb8fe188..45a08acb9 100644
--- a/youlai-common/common-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java
+++ b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/java/com/youlai/common/sms/service/impl/AliyunSmsService.java
@@ -8,7 +8,7 @@ import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
-import com.youlai.common.sms.property.AliyunSmsProperties;
+import com.youlai.common.sms.config.AliyunSmsProperties;
import com.youlai.common.sms.service.SmsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
diff --git a/youlai-common/common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 50%
rename from youlai-common/common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
rename to youlai-common/common-thirdparty/common-thirdparty-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index c81208e7a..80ada9656 100644
--- a/youlai-common/common-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/youlai-common/common-thirdparty/common-thirdparty-sms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1,2 +1,2 @@
-com.youlai.common.sms.property.AliyunSmsProperties
+com.youlai.common.sms.config.AliyunSmsProperties
com.youlai.common.sms.service.impl.AliyunSmsService
diff --git a/youlai-common/common-thirdparty/pom.xml b/youlai-common/common-thirdparty/pom.xml
new file mode 100644
index 000000000..01934be60
--- /dev/null
+++ b/youlai-common/common-thirdparty/pom.xml
@@ -0,0 +1,25 @@
+
+
+ 4.0.0
+
+ com.youlai
+ youlai-common
+ 3.2.1
+
+
+ common-thirdparty
+ pom
+
+ common-thirdparty-sms
+ common-thirdparty-oss
+
+
+
+ 17
+ 17
+ UTF-8
+
+
+
\ No newline at end of file
diff --git a/youlai-common/common-web/pom.xml b/youlai-common/common-web/pom.xml
index 82ee5c0fd..780af98fe 100644
--- a/youlai-common/common-web/pom.xml
+++ b/youlai-common/common-web/pom.xml
@@ -13,16 +13,6 @@
-
- com.youlai
- common-core
-
-
-
- com.youlai
- common-redis
-
-
org.springframework.boot
spring-boot-starter-web
@@ -59,6 +49,16 @@
spring-boot-starter-validation
+
+ com.youlai
+ common-core
+
+
+
+ com.youlai
+ common-middleware-redis
+
+
com.youlai
common-security
diff --git a/youlai-common/pom.xml b/youlai-common/pom.xml
index edd588425..5b3beb0b6 100644
--- a/youlai-common/pom.xml
+++ b/youlai-common/pom.xml
@@ -15,12 +15,10 @@
common-core
- common-redis
common-web
common-mybatis
- common-rabbitmq
common-security
- common-seata
- common-sms
+ common-thirdparty
+ common-middleware
diff --git a/youlai-gateway/pom.xml b/youlai-gateway/pom.xml
index 0d87604dc..fa3cd906a 100644
--- a/youlai-gateway/pom.xml
+++ b/youlai-gateway/pom.xml
@@ -80,7 +80,6 @@
spring-boot-configuration-processor
-
com.youlai
common-core
@@ -88,7 +87,7 @@
com.youlai
- common-redis
+ common-middleware-redis
diff --git a/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java b/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java
index cb9de2b89..de365e952 100644
--- a/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java
+++ b/youlai-gateway/src/main/java/com/youlai/gateway/GatewayApplication.java
@@ -4,6 +4,11 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+/**
+ * 网关服务启动类
+ *
+ * @author ray
+ */
@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {
diff --git a/youlai-system/system-boot/pom.xml b/youlai-system/system-boot/pom.xml
index 2e5771167..7765b0439 100644
--- a/youlai-system/system-boot/pom.xml
+++ b/youlai-system/system-boot/pom.xml
@@ -18,6 +18,13 @@
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
org.springframework.cloud
@@ -59,17 +66,6 @@
sentinel-datasource-nacos
-
-
- io.minio
- minio
-
-
-
- com.aliyun.oss
- aliyun-sdk-oss
-
-
com.alibaba
easyexcel
@@ -80,21 +76,11 @@
system-api
-
- com.youlai
- common-redis
-
-
com.youlai
common-mybatis
-
- com.youlai
- common-rabbitmq
-
-
com.youlai
common-security
@@ -102,14 +88,17 @@
com.youlai
- common-sms
+ common-middleware-redis
-
- org.springframework.boot
- spring-boot-starter-test
- test
+ com.youlai
+ common-middleware-rabbitmq
+
+
+
+ com.youlai
+ common-thirdparty-sms
diff --git a/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java b/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java
index 7b5de8acf..b11510dc6 100644
--- a/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java
+++ b/youlai-system/system-boot/src/main/java/com/youlai/system/SystemApplication.java
@@ -4,6 +4,11 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+/**
+ * 系统服务启动类
+ *
+ * @author ray
+ */
@SpringBootApplication
@EnableDiscoveryClient
public class SystemApplication {