refactor: 项目结构调整重构

This commit is contained in:
haoxr 2024-02-01 17:34:15 +08:00
parent 18445683bd
commit 7916b82dff
43 changed files with 56 additions and 265 deletions

View File

@ -15,7 +15,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>

View File

@ -15,7 +15,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>

View File

@ -15,7 +15,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>

View File

@ -80,7 +80,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-resourceserver</artifactId>
<artifactId>common-security</artifactId>
</dependency>
<dependency>

View File

@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>

View File

@ -70,7 +70,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-resourceserver</artifactId>
<artifactId>common-security</artifactId>
</dependency>
<dependency>

35
pom.xml
View File

@ -35,39 +35,40 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring-boot.version>3.1.5</spring-boot.version>
<spring-boot.version>3.2.1</spring-boot.version>
<!-- spring cloud & alibaba -->
<spring-cloud.version>2022.0.4</spring-cloud.version>
<spring-cloud.version>2023.0.0</spring-cloud.version>
<spring-cloud-alibaba.version>2022.0.0.0</spring-cloud-alibaba.version>
<!-- spring authorization server -->
<spring-authorization-server.version>1.1.3</spring-authorization-server.version>
<spring-authorization-server.version>1.2.1</spring-authorization-server.version>
<!-- db && orm -->
<!-- 数据库 & ORM -->
<mysql.version>8.0.28</mysql.version>
<druid.version>1.2.20</druid.version>
<mybatis-plus.version>3.5.5</mybatis-plus.version>
<!-- api doc -->
<!-- 接口文档工具 -->
<knife4j.version>4.3.0</knife4j.version>
<swagger.version>2.1.0</swagger.version>
<!-- tools -->
<hutool.version>5.8.22</hutool.version>
<!-- 工具 -->
<hutool.version>5.8.25</hutool.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<weixin-java.version>4.1.5.B</weixin-java.version>
<easyexcel.version>3.3.2</easyexcel.version>
<nimbus-jose-jwt.version>9.16.1</nimbus-jose-jwt.version>
<!-- 阿里云短信 -->
<aliyun.java.sdk.core.version>4.5.25</aliyun.java.sdk.core.version>
<aliyun.java.sdk.dysmsapi.version>2.1.0</aliyun.java.sdk.dysmsapi.version>
<aliyun.java.sdk.core.version>4.6.4</aliyun.java.sdk.core.version>
<aliyun.java.sdk.dysmsapi.version>2.2.1</aliyun.java.sdk.dysmsapi.version>
<!-- 阿里云OSS -->
<aliyun-sdk-oss.version>3.17.4</aliyun-sdk-oss.version>
<!-- minio -->
<minio.version>8.5.6</minio.version>
<okhttp3.version>4.8.1</okhttp3.version>
<!-- aliyun oss sdk -->
<aliyun-sdk-oss.version>3.16.3</aliyun-sdk-oss.version>
<!-- redisson 分布式锁 -->
<redisson.version>3.24.3</redisson.version>
@ -105,7 +106,6 @@
<scope>import</scope>
</dependency>
<!-- API 接口文档 -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
@ -115,7 +115,6 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
@ -162,7 +161,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
<version>${project.version}</version>
</dependency>
@ -204,13 +203,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-file</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-resourceserver</artifactId>
<artifactId>common-security</artifactId>
<version>${project.version}</version>
</dependency>

View File

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
<dependencies>

View File

@ -0,0 +1,15 @@
package com.youlai.common.constant;
/**
* 全局常量
*
* @author haoxr
* @since 2021/10/30 9:32
*/
public interface GlobalConstants {
/**
* 全局状态-
*/
Integer STATUS_YES = 1;
}

View File

@ -1,6 +1,6 @@
package com.youlai.common.constant;
public interface SecurityConstants {
public interface RedisConstants {
/**
* 黑名单TOKEN Key前缀
@ -13,20 +13,25 @@ public interface SecurityConstants {
String CAPTCHA_CODE_PREFIX = "captcha_code:";
/**
* 短信验证码key前缀
* 登录短信验证码key前缀
*/
String SMS_CODE_PREFIX = "sms_code:";
String LOGIN_SMS_CODE_PREFIX = "sms_code:login";
/**
* Knife4j测试客户端IDKnife4j自动填充的 access_token 须原生返回不能被包装成业务码数据格式
* 注册短信验证码key前缀
*/
String TEST_OAUTH2_CLIENT_ID = "client";
String REGISTER_SMS_CODE_PREFIX = "sms_code:register";
String JWK_SET_KEY = "jwk_set";
/**
* 角色和权限缓存前缀
*/
String ROLE_PERMS_PREFIX = "role_perms:";
/**
* JWT 密钥对(包含公钥和私钥)
*/
String JWK_SET_KEY = "jwk_set";
}

View File

@ -4,14 +4,14 @@ package com.youlai.common.constant;
* 系统常量
*
* @author haoxr
* @since 2021/10/30 9:32
* @since 2021/10/30
*/
public interface SystemConstants {
/**
* 根部门ID
*/
Long ROOT_NODE_ID = 0l;
Long ROOT_NODE_ID = 0L;
/**

View File

@ -1,16 +0,0 @@
package com.youlai.common.constant;
/**
* Excel 常量
*
* @author: haoxr
* @date: 2023/03/24
*/
public interface ExcelConstants {
/**
* Excel 模板目录
*/
String EXCEL_TEMPLATE_DIR="excel-templates";
}

View File

@ -1,31 +0,0 @@
package com.youlai.common.constant;
/**
* 全局常量
*
* @author haoxr
* @since 2021/10/30 9:32
*/
public interface GlobalConstants {
/**
* 全局状态-
*/
Integer STATUS_YES = 1;
/**
* 超级管理员角色编码
*/
String ROOT_ROLE_CODE = "ROOT";
/**
* [ {接口路径:[角色编码]},...]
*/
String URL_PERM_ROLES_KEY = "permission:url";
/**
* [{按钮权限标识:[角色编码]},...]
*/
String BTN_PERM_ROLES_KEY = "permission:btn";
}

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>youlai-common</artifactId>
<groupId>com.youlai</groupId>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-file</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,12 +0,0 @@
package com.youlai.common.file.model;
import lombok.Data;
@Data
public class FileInfo {
private String name;
private String url;
}

View File

@ -1,3 +0,0 @@
com.youlai.common.file.service.impl.MinioOssService
com.youlai.common.file.service.impl.AliyunOssService
com.youlai.common.file.controller.FileController

View File

@ -45,7 +45,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-resourceserver</artifactId>
<artifactId>common-security</artifactId>
<optional>true</optional>
</dependency>

View File

@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>

View File

@ -1,4 +0,0 @@
com.youlai.common.security.service.PermissionService
com.youlai.common.security.config.ResourceServerConfig
com.youlai.common.security.exception.MyAccessDeniedHandler
com.youlai.common.security.exception.MyAuthenticationEntryPoint

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>youlai-common</artifactId>
<groupId>com.youlai</groupId>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-sms</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-redis</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,32 +0,0 @@
package com.youlai.common.sms.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* 阿里云短信配置
* <p>
* 配置文件 youlai-common.yml
*
* @author haoxr
* @since 2021/10/13 22:44
*/
@ConfigurationProperties(prefix = "aliyun.sms")
@Configuration
@Data
public class AliyunSmsProperties {
private String accessKeyId;
private String accessKeySecret;
private String domain;
private String regionId;
private String templateCode;
private String signName;
}

View File

@ -1,29 +0,0 @@
package com.youlai.common.sms.controller;
import com.youlai.common.result.Result;
import com.youlai.common.sms.service.AliyunSmsService;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "短信验证码")
@RestController
@RequestMapping("/sms-code")
@RequiredArgsConstructor
public class SmsCodeController {
private final AliyunSmsService aliyunSmsService;
@Operation(summary = "发送短信验证码")
@PostMapping
public Result sendSmsCode(
@Parameter(name = "手机号") String phoneNumber
) {
boolean result = aliyunSmsService.sendSmsCode(phoneNumber);
return Result.judge(result);
}
}

View File

@ -1,4 +0,0 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.youlai.common.sms.config.AliyunSmsProperties,\
com.youlai.common.sms.service.AliyunSmsService, \
com.youlai.common.sms.controller.SmsCodeController

View File

@ -15,7 +15,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>
@ -66,7 +66,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-resourceserver</artifactId>
<artifactId>common-security</artifactId>
<optional>true</optional>
</dependency>

View File

@ -15,15 +15,13 @@
<modules>
<module>common-apidoc</module>
<module>common-core</module>
<module>common-base</module>
<module>common-redis</module>
<module>common-web</module>
<module>common-mybatis</module>
<module>common-rabbitmq</module>
<module>common-log</module>
<module>common-sms</module>
<module>common-file</module>
<module>common-resourceserver</module>
<module>common-security</module>
<module>common-seata</module>
</modules>
</project>

View File

@ -15,7 +15,7 @@
<dependency>
<groupId>com.youlai</groupId>
<artifactId>common-core</artifactId>
<artifactId>common-base</artifactId>
</dependency>
<dependency>