From ad11871c67d3991c3b94b58dc53869b32fb95b05 Mon Sep 17 00:00:00 2001
From: bunny <1319900154@qq.com>
Date: Mon, 24 Mar 2025 22:14:21 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
LICENSE => LICENSE | 0
common/pom.xml | 6 +-
common/service-utils/pom.xml | 70 --------
.../bunny/dao/dto/system/user/LoginDto.java | 1 +
.../bunny/dao/entity/quartz/Schedulers.java | 3 +
pom.xml | 9 +-
service/pom.xml | 165 ++++++++++++------
...ation.java => AuthServiceApplication.java} | 4 +-
.../bunny/services/aop/AnnotationScanner.java | 4 +-
.../bunny/services/aop/JobExecuteAspect.java | 1 -
.../ControllerStringParamTrimConfig.java | 2 +-
.../bunny/services}/config/Knife4jConfig.java | 2 +-
.../config/MyBatisPlusFieldConfig.java | 4 +-
.../services}/config/MybatisPlusConfig.java | 2 +-
.../services}/config/RedisConfiguration.java | 4 +-
.../bunny/services}/context/BaseContext.java | 2 +-
.../exception/AuthCustomerException.java | 2 +-
.../exception/GlobalExceptionHandler.java | 38 +---
...CustomAuthorizationManagerServiceImpl.java | 4 +-
.../filter/TokenLoginFilterService.java | 3 +-
.../SecurityAuthenticationEntryPoint.java | 2 +-
.../impl/ConfigurationServiceImpl.java | 2 +-
.../service/impl/DeptServiceImpl.java | 2 +-
.../impl/EmailTemplateServiceImpl.java | 2 +-
.../service/impl/EmailUsersServiceImpl.java | 2 +-
.../service/impl/FilesServiceImpl.java | 10 +-
.../service/impl/I18nServiceImpl.java | 2 +-
.../service/impl/I18nTypeServiceImpl.java | 2 +-
.../service/impl/MenuIconServiceImpl.java | 2 +-
.../impl/MessageReceivedServiceImpl.java | 4 +-
.../service/impl/MessageServiceImpl.java | 4 +-
.../service/impl/PowerServiceImpl.java | 2 +-
.../service/impl/RoleServiceImpl.java | 2 +-
.../service/impl/RouterRoleServiceImpl.java | 2 +-
.../service/impl/RouterServiceImpl.java | 4 +-
.../service/impl/SchedulersServiceImpl.java | 2 +-
.../service/impl/UserLoginLogServiceImpl.java | 2 +-
.../service/impl/UserRoleServiceImpl.java | 4 +-
.../service/impl/UserServiceImpl.java | 8 +-
.../cn/bunny/services}/utils/FileUtil.java | 2 +-
.../cn/bunny/services}/utils/JwtHelper.java | 4 +-
.../bunny/services}/utils/ResponseUtil.java | 2 +-
.../cn/bunny/services/utils/RoleUtil.java | 2 +-
.../cn/bunny/services/utils/UserUtil.java | 7 +-
.../email/AbstractSenderEmailTemplate.java | 4 +-
.../cn/bunny/services}/utils/ip/IpEntity.java | 2 +-
.../cn/bunny/services}/utils/ip/IpUtil.java | 2 +-
.../services}/utils/mail/MailSenderUtil.java | 2 +-
.../services}/utils/mail/template-propties | 0
.../utils/minio/MinioProperties.java | 2 +-
.../services}/utils/minio/MinioUtil.java | 4 +-
.../src/main/resources/application-dev.yml | 13 +-
service/src/main/resources/banner.txt | 4 +-
.../src/main/resources/ipdb/ip2region.xdb | Bin
.../src/main/resources/mapper/RoleMapper.xml | 3 +-
55 files changed, 204 insertions(+), 235 deletions(-)
rename LICENSE => LICENSE (100%)
delete mode 100644 common/service-utils/pom.xml
rename service/src/main/java/cn/bunny/services/{ServiceApplication.java => AuthServiceApplication.java} (86%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/config/ControllerStringParamTrimConfig.java (98%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/config/Knife4jConfig.java (98%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/config/MyBatisPlusFieldConfig.java (93%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/config/MybatisPlusConfig.java (97%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/config/RedisConfiguration.java (98%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/context/BaseContext.java (95%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/exception/AuthCustomerException.java (95%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/exception/GlobalExceptionHandler.java (79%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/FileUtil.java (96%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/JwtHelper.java (99%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/ResponseUtil.java (95%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/ip/IpEntity.java (92%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/ip/IpUtil.java (99%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/mail/MailSenderUtil.java (98%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/mail/template-propties (100%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/minio/MinioProperties.java (95%)
rename {common/service-utils/src/main/java/cn/bunny/common/service => service/src/main/java/cn/bunny/services}/utils/minio/MinioUtil.java (98%)
rename {common/service-utils => service}/src/main/resources/ipdb/ip2region.xdb (100%)
diff --git a/ LICENSE b/LICENSE
similarity index 100%
rename from LICENSE
rename to LICENSE
diff --git a/common/pom.xml b/common/pom.xml
index 91af6ed..360b4b0 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -12,7 +12,7 @@
common Maven Webapp
https://maven.apache.org
- service-utils
+
common-generator
@@ -22,10 +22,6 @@
dao
0.0.1-SNAPSHOT
-
- org.springframework.boot
- spring-boot-starter-web
-
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
diff --git a/common/service-utils/pom.xml b/common/service-utils/pom.xml
deleted file mode 100644
index f846523..0000000
--- a/common/service-utils/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
- 4.0.0
-
- cn.bunny
- common
- 0.0.1-SNAPSHOT
-
-
- service-utils
- jar
- service-utils
- https://maven.apache.org
-
-
- UTF-8
-
-
-
-
-
- javax.xml.bind
- jaxb-api
- 2.3.1
-
-
-
- org.apache.httpcomponents
- httpclient
- 4.5.14
-
-
-
- org.springframework.boot
- spring-boot-starter-data-redis
-
-
-
- org.redisson
- redisson
- 3.26.1
-
-
-
- io.minio
- minio
-
-
-
- org.lionsoul
- ip2region
- 2.6.5
-
-
-
- org.springframework
- spring-websocket
-
-
-
- org.springframework.boot
- spring-boot-starter-mail
-
-
-
- org.springframework.boot
- spring-boot-starter-validation
-
-
-
diff --git a/dao/src/main/java/cn/bunny/dao/dto/system/user/LoginDto.java b/dao/src/main/java/cn/bunny/dao/dto/system/user/LoginDto.java
index f369e25..3a0171e 100644
--- a/dao/src/main/java/cn/bunny/dao/dto/system/user/LoginDto.java
+++ b/dao/src/main/java/cn/bunny/dao/dto/system/user/LoginDto.java
@@ -41,4 +41,5 @@ public class LoginDto {
@Schema(name = "readMeDay", title = "记住我的天数")
private Long readMeDay = 1L;
+
}
diff --git a/dao/src/main/java/cn/bunny/dao/entity/quartz/Schedulers.java b/dao/src/main/java/cn/bunny/dao/entity/quartz/Schedulers.java
index 994d4e2..fa88247 100644
--- a/dao/src/main/java/cn/bunny/dao/entity/quartz/Schedulers.java
+++ b/dao/src/main/java/cn/bunny/dao/entity/quartz/Schedulers.java
@@ -1,5 +1,7 @@
package cn.bunny.dao.entity.quartz;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
@@ -24,6 +26,7 @@ import java.io.Serializable;
public class Schedulers implements Serializable {
@Schema(name = "jobName", title = "任务名称")
+ @TableId(type = IdType.NONE)
private String jobName;
@Schema(name = "jobGroup", title = "任务分组")
diff --git a/pom.xml b/pom.xml
index 5b761e1..0667940 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,19 +27,19 @@
17
3.8.1
3.5.6
- 8.0.30
+ 8.0.33
4.5.0
2.0.47
- 8.5.9
+ 8.5.17
1.18.32
0.9.1
- 3.3.3
+ 4.0.2
2.10.1
1.9.21
6.1.0
2.2
3.1
- 5.1.0
+ 6.2.1
4.3.1
2.12.3
2.3.2
@@ -188,5 +188,4 @@
-
diff --git a/service/pom.xml b/service/pom.xml
index aad4de0..2d8c695 100644
--- a/service/pom.xml
+++ b/service/pom.xml
@@ -14,61 +14,20 @@
UTF-8
- 192.168.3.98:1100
- 192.168.3.98:2375
bunny-service
cn.bunny
- service-utils
+ dao
0.0.1-SNAPSHOT
-
-
- org.springframework.boot
- spring-boot-devtools
- runtime
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-thymeleaf
-
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
-
- org.springframework.security
- spring-security-test
-
-
+
org.springframework.boot
spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-actuator
- 3.2.3
-
-
-
- junit
- junit
- 3.8.1
-
-
-
- org.springframework.boot
- spring-boot-starter-test
-
org.aspectj
@@ -78,31 +37,135 @@
org.aspectj
aspectjweaver
-
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+
+ org.quartz-scheduler
+ quartz
+
+
+
+
+ junit
+ junit
+ 3.8.1
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+
+
+ org.springframework.security
+ spring-security-test
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
org.springframework.boot
spring-boot-starter-websocket
+
+ org.springframework
+ spring-websocket
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+ 3.2.3
+
+
+
+
+ cn.hutool
+ hutool-all
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.14
+
+
+
+
+ mysql
+ mysql-connector-java
+
-
+
- org.quartz-scheduler
- quartz
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+ io.minio
+ minio
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+
+
+
+ org.lionsoul
+ ip2region
+ 2.6.5
+
+
+
+
+ org.springframework
+ spring-context-support
+ 6.1.6
+
+
+
+ javax.xml.bind
+ jaxb-api
+ 2.3.1
com.mchange
c3p0
0.9.5.5
-
- org.springframework
- spring-context-support
- 6.1.6
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
diff --git a/service/src/main/java/cn/bunny/services/ServiceApplication.java b/service/src/main/java/cn/bunny/services/AuthServiceApplication.java
similarity index 86%
rename from service/src/main/java/cn/bunny/services/ServiceApplication.java
rename to service/src/main/java/cn/bunny/services/AuthServiceApplication.java
index 7a875f5..e1635c1 100644
--- a/service/src/main/java/cn/bunny/services/ServiceApplication.java
+++ b/service/src/main/java/cn/bunny/services/AuthServiceApplication.java
@@ -14,8 +14,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableCaching
@EnableTransactionManagement
@SpringBootApplication
-public class ServiceApplication {
+public class AuthServiceApplication {
public static void main(String[] args) {
- SpringApplication.run(ServiceApplication.class, args);
+ SpringApplication.run(AuthServiceApplication.class, args);
}
}
diff --git a/service/src/main/java/cn/bunny/services/aop/AnnotationScanner.java b/service/src/main/java/cn/bunny/services/aop/AnnotationScanner.java
index 85273a2..2e874a2 100644
--- a/service/src/main/java/cn/bunny/services/aop/AnnotationScanner.java
+++ b/service/src/main/java/cn/bunny/services/aop/AnnotationScanner.java
@@ -1,7 +1,7 @@
package cn.bunny.services.aop;
-import cn.bunny.common.service.exception.AuthCustomerException;
import cn.bunny.dao.vo.result.ResultCodeEnum;
+import cn.bunny.services.exception.AuthCustomerException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
@@ -12,7 +12,7 @@ import java.util.HashSet;
import java.util.Set;
/**
- * * 扫描指定目录下所有类
+ * 扫描指定目录下所有类
*/
@Component
public class AnnotationScanner {
diff --git a/service/src/main/java/cn/bunny/services/aop/JobExecuteAspect.java b/service/src/main/java/cn/bunny/services/aop/JobExecuteAspect.java
index 1d9bb58..cb30b16 100644
--- a/service/src/main/java/cn/bunny/services/aop/JobExecuteAspect.java
+++ b/service/src/main/java/cn/bunny/services/aop/JobExecuteAspect.java
@@ -104,5 +104,4 @@ public class JobExecuteAspect {
@Pointcut("execution(* cn.bunny.services.quartz.*.execute(..))")
public void pointCut() {
}
-
}
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/ControllerStringParamTrimConfig.java b/service/src/main/java/cn/bunny/services/config/ControllerStringParamTrimConfig.java
similarity index 98%
rename from common/service-utils/src/main/java/cn/bunny/common/service/config/ControllerStringParamTrimConfig.java
rename to service/src/main/java/cn/bunny/services/config/ControllerStringParamTrimConfig.java
index 8f393dc..cec6403 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/config/ControllerStringParamTrimConfig.java
+++ b/service/src/main/java/cn/bunny/services/config/ControllerStringParamTrimConfig.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.config;
+package cn.bunny.services.config;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/Knife4jConfig.java b/service/src/main/java/cn/bunny/services/config/Knife4jConfig.java
similarity index 98%
rename from common/service-utils/src/main/java/cn/bunny/common/service/config/Knife4jConfig.java
rename to service/src/main/java/cn/bunny/services/config/Knife4jConfig.java
index 1130b53..c2daf93 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/config/Knife4jConfig.java
+++ b/service/src/main/java/cn/bunny/services/config/Knife4jConfig.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.config;
+package cn.bunny.services.config;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/MyBatisPlusFieldConfig.java b/service/src/main/java/cn/bunny/services/config/MyBatisPlusFieldConfig.java
similarity index 93%
rename from common/service-utils/src/main/java/cn/bunny/common/service/config/MyBatisPlusFieldConfig.java
rename to service/src/main/java/cn/bunny/services/config/MyBatisPlusFieldConfig.java
index 6f6e278..02c2937 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/config/MyBatisPlusFieldConfig.java
+++ b/service/src/main/java/cn/bunny/services/config/MyBatisPlusFieldConfig.java
@@ -1,6 +1,6 @@
-package cn.bunny.common.service.config;
+package cn.bunny.services.config;
-import cn.bunny.common.service.context.BaseContext;
+import cn.bunny.services.context.BaseContext;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java b/service/src/main/java/cn/bunny/services/config/MybatisPlusConfig.java
similarity index 97%
rename from common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java
rename to service/src/main/java/cn/bunny/services/config/MybatisPlusConfig.java
index beb7258..5dca69f 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java
+++ b/service/src/main/java/cn/bunny/services/config/MybatisPlusConfig.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.config;
+package cn.bunny.services.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/RedisConfiguration.java b/service/src/main/java/cn/bunny/services/config/RedisConfiguration.java
similarity index 98%
rename from common/service-utils/src/main/java/cn/bunny/common/service/config/RedisConfiguration.java
rename to service/src/main/java/cn/bunny/services/config/RedisConfiguration.java
index be3f46b..b18a840 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/config/RedisConfiguration.java
+++ b/service/src/main/java/cn/bunny/services/config/RedisConfiguration.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.config;
+package cn.bunny.services.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
@@ -52,7 +52,7 @@ public class RedisConfiguration {
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
// 开启Redis事务
- redisTemplate.setEnableTransactionSupport(true);
+ // redisTemplate.setEnableTransactionSupport(true);
return redisTemplate;
}
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/context/BaseContext.java b/service/src/main/java/cn/bunny/services/context/BaseContext.java
similarity index 95%
rename from common/service-utils/src/main/java/cn/bunny/common/service/context/BaseContext.java
rename to service/src/main/java/cn/bunny/services/context/BaseContext.java
index 949c520..4276cc3 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/context/BaseContext.java
+++ b/service/src/main/java/cn/bunny/services/context/BaseContext.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.context;
+package cn.bunny.services.context;
import cn.bunny.dao.vo.system.user.LoginVo;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/exception/AuthCustomerException.java b/service/src/main/java/cn/bunny/services/exception/AuthCustomerException.java
similarity index 95%
rename from common/service-utils/src/main/java/cn/bunny/common/service/exception/AuthCustomerException.java
rename to service/src/main/java/cn/bunny/services/exception/AuthCustomerException.java
index 07ba0f7..7c2fd94 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/exception/AuthCustomerException.java
+++ b/service/src/main/java/cn/bunny/services/exception/AuthCustomerException.java
@@ -1,4 +1,4 @@
-package cn.bunny.common.service.exception;
+package cn.bunny.services.exception;
import cn.bunny.dao.vo.result.ResultCodeEnum;
import lombok.Getter;
diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java b/service/src/main/java/cn/bunny/services/exception/GlobalExceptionHandler.java
similarity index 79%
rename from common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java
rename to service/src/main/java/cn/bunny/services/exception/GlobalExceptionHandler.java
index 7c42b49..a02e299 100644
--- a/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java
+++ b/service/src/main/java/cn/bunny/services/exception/GlobalExceptionHandler.java
@@ -1,10 +1,11 @@
-package cn.bunny.common.service.exception;
+package cn.bunny.services.exception;
-import cn.bunny.common.service.context.BaseContext;
import cn.bunny.dao.vo.result.Result;
import cn.bunny.dao.vo.result.ResultCodeEnum;
+import cn.bunny.services.context.BaseContext;
import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.MyBatisSystemException;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.MethodArgumentNotValidException;
@@ -38,7 +39,8 @@ public class GlobalExceptionHandler {
public Result