From 7ff26c45962e916370aeaeaa547974dbf727fdb4 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 25 Dec 2024 20:34:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor(log):=20=E4=BC=98=E5=8C=96=E5=8C=85?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/top/continew/starter/log/aspect/LogAspect.java | 2 +- .../starter/log/autoconfigure/LogAutoConfiguration.java | 4 ++-- .../top/continew/starter/log/handler/AopLogHandler.java | 1 + .../starter/log/{handler => }/AbstractLogHandler.java | 6 +++--- .../top/continew/starter/log/{handler => }/LogFilter.java | 2 +- .../top/continew/starter/log/{handler => }/LogHandler.java | 2 +- .../log/http/{recordable => }/RecordableHttpRequest.java | 2 +- .../log/http/{recordable => }/RecordableHttpResponse.java | 2 +- .../impl => servlet}/RecordableServletHttpRequest.java | 4 ++-- .../impl => servlet}/RecordableServletHttpResponse.java | 4 ++-- .../main/java/top/continew/starter/log/model/LogRecord.java | 4 ++-- .../java/top/continew/starter/log/model/LogRequest.java | 2 +- .../java/top/continew/starter/log/model/LogResponse.java | 2 +- .../starter/log/autoconfigure/LogAutoConfiguration.java | 4 ++-- .../continew/starter/log/handler/InterceptorLogHandler.java | 1 + .../continew/starter/log/interceptor/LogInterceptor.java | 2 +- 16 files changed, 23 insertions(+), 21 deletions(-) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/{handler => }/AbstractLogHandler.java (96%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/{handler => }/LogFilter.java (99%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/{handler => }/LogHandler.java (98%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/{recordable => }/RecordableHttpRequest.java (96%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/{recordable => }/RecordableHttpResponse.java (96%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/{recordable/impl => servlet}/RecordableServletHttpRequest.java (96%) rename continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/{recordable/impl => servlet}/RecordableServletHttpResponse.java (94%) diff --git a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/aspect/LogAspect.java b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/aspect/LogAspect.java index 149ea807..d9c84299 100644 --- a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/aspect/LogAspect.java +++ b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/aspect/LogAspect.java @@ -32,7 +32,7 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import top.continew.starter.log.annotation.Log; import top.continew.starter.log.dao.LogDao; -import top.continew.starter.log.handler.LogHandler; +import top.continew.starter.log.LogHandler; import top.continew.starter.log.model.LogProperties; import top.continew.starter.log.model.LogRecord; import top.continew.starter.web.util.SpringWebUtils; diff --git a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java index f3e28c67..dc71abec 100644 --- a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java +++ b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java @@ -30,8 +30,8 @@ import top.continew.starter.log.aspect.LogAspect; import top.continew.starter.log.dao.LogDao; import top.continew.starter.log.dao.impl.DefaultLogDaoImpl; import top.continew.starter.log.handler.AopLogHandler; -import top.continew.starter.log.handler.LogFilter; -import top.continew.starter.log.handler.LogHandler; +import top.continew.starter.log.LogFilter; +import top.continew.starter.log.LogHandler; import top.continew.starter.log.model.LogProperties; /** diff --git a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/handler/AopLogHandler.java b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/handler/AopLogHandler.java index 9ba6a9e7..2ce621f0 100644 --- a/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/handler/AopLogHandler.java +++ b/continew-starter-log/continew-starter-log-aop/src/main/java/top/continew/starter/log/handler/AopLogHandler.java @@ -17,6 +17,7 @@ package top.continew.starter.log.handler; import cn.hutool.core.text.CharSequenceUtil; +import top.continew.starter.log.AbstractLogHandler; import top.continew.starter.log.model.LogRecord; import java.lang.reflect.Method; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/AbstractLogHandler.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/AbstractLogHandler.java similarity index 96% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/AbstractLogHandler.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/AbstractLogHandler.java index 26702246..33a46d71 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/AbstractLogHandler.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/AbstractLogHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.handler; +package top.continew.starter.log; import cn.hutool.core.annotation.AnnotationUtil; import cn.hutool.core.text.CharSequenceUtil; @@ -22,8 +22,8 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import top.continew.starter.log.annotation.Log; import top.continew.starter.log.enums.Include; -import top.continew.starter.log.http.recordable.impl.RecordableServletHttpRequest; -import top.continew.starter.log.http.recordable.impl.RecordableServletHttpResponse; +import top.continew.starter.log.http.servlet.RecordableServletHttpRequest; +import top.continew.starter.log.http.servlet.RecordableServletHttpResponse; import top.continew.starter.log.model.LogRecord; import java.lang.reflect.Method; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogFilter.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogFilter.java similarity index 99% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogFilter.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogFilter.java index 47ac36dc..b585a1b3 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogFilter.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.handler; +package top.continew.starter.log; import cn.hutool.extra.spring.SpringUtil; import jakarta.servlet.FilterChain; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogHandler.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogHandler.java similarity index 98% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogHandler.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogHandler.java index fbc4c229..15e0a9f4 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/handler/LogHandler.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/LogHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.handler; +package top.continew.starter.log; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpRequest.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpRequest.java similarity index 96% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpRequest.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpRequest.java index 9a086685..07ce377d 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpRequest.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.http.recordable; +package top.continew.starter.log.http; import java.net.URI; import java.util.Map; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpResponse.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpResponse.java similarity index 96% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpResponse.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpResponse.java index b905e880..b3a643cf 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/RecordableHttpResponse.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/RecordableHttpResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.http.recordable; +package top.continew.starter.log.http; import java.util.Map; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpRequest.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpRequest.java similarity index 96% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpRequest.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpRequest.java index 3630ed75..86c87d06 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpRequest.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.http.recordable.impl; +package top.continew.starter.log.http.servlet; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.util.StrUtil; @@ -25,7 +25,7 @@ import org.springframework.web.util.ContentCachingRequestWrapper; import org.springframework.web.util.UriUtils; import org.springframework.web.util.WebUtils; import top.continew.starter.core.constant.StringConstants; -import top.continew.starter.log.http.recordable.RecordableHttpRequest; +import top.continew.starter.log.http.RecordableHttpRequest; import java.net.URI; import java.net.URISyntaxException; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpResponse.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpResponse.java similarity index 94% rename from continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpResponse.java rename to continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpResponse.java index 698dbda7..17a5c931 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/recordable/impl/RecordableServletHttpResponse.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/http/servlet/RecordableServletHttpResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.starter.log.http.recordable.impl; +package top.continew.starter.log.http.servlet; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.util.StrUtil; @@ -22,7 +22,7 @@ import cn.hutool.json.JSONUtil; import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.util.ContentCachingResponseWrapper; import org.springframework.web.util.WebUtils; -import top.continew.starter.log.http.recordable.RecordableHttpResponse; +import top.continew.starter.log.http.RecordableHttpResponse; import top.continew.starter.web.util.ServletUtils; import java.util.Map; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRecord.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRecord.java index 935e08a1..c652bcae 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRecord.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRecord.java @@ -17,8 +17,8 @@ package top.continew.starter.log.model; import top.continew.starter.log.enums.Include; -import top.continew.starter.log.http.recordable.RecordableHttpRequest; -import top.continew.starter.log.http.recordable.RecordableHttpResponse; +import top.continew.starter.log.http.RecordableHttpRequest; +import top.continew.starter.log.http.RecordableHttpResponse; import java.time.Duration; import java.time.Instant; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRequest.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRequest.java index 19122cda..a5f90c00 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRequest.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogRequest.java @@ -21,7 +21,7 @@ import org.springframework.http.HttpHeaders; import top.continew.starter.core.util.ExceptionUtils; import top.continew.starter.core.util.IpUtils; import top.continew.starter.log.enums.Include; -import top.continew.starter.log.http.recordable.RecordableHttpRequest; +import top.continew.starter.log.http.RecordableHttpRequest; import top.continew.starter.web.util.ServletUtils; import java.net.URI; diff --git a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogResponse.java b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogResponse.java index 7c2dd026..fbba3e7e 100644 --- a/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogResponse.java +++ b/continew-starter-log/continew-starter-log-core/src/main/java/top/continew/starter/log/model/LogResponse.java @@ -17,7 +17,7 @@ package top.continew.starter.log.model; import top.continew.starter.log.enums.Include; -import top.continew.starter.log.http.recordable.RecordableHttpResponse; +import top.continew.starter.log.http.RecordableHttpResponse; import java.util.Map; import java.util.Set; diff --git a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java index 77fc5749..51992572 100644 --- a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java +++ b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/autoconfigure/LogAutoConfiguration.java @@ -30,8 +30,8 @@ import top.continew.starter.log.annotation.ConditionalOnEnabledLog; import top.continew.starter.log.dao.LogDao; import top.continew.starter.log.dao.impl.DefaultLogDaoImpl; import top.continew.starter.log.handler.InterceptorLogHandler; -import top.continew.starter.log.handler.LogFilter; -import top.continew.starter.log.handler.LogHandler; +import top.continew.starter.log.LogFilter; +import top.continew.starter.log.LogHandler; import top.continew.starter.log.interceptor.LogInterceptor; import top.continew.starter.log.model.LogProperties; diff --git a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/handler/InterceptorLogHandler.java b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/handler/InterceptorLogHandler.java index a44435f4..adffab87 100644 --- a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/handler/InterceptorLogHandler.java +++ b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/handler/InterceptorLogHandler.java @@ -20,6 +20,7 @@ import cn.hutool.core.annotation.AnnotationUtil; import cn.hutool.core.text.CharSequenceUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import top.continew.starter.log.AbstractLogHandler; import top.continew.starter.log.model.LogRecord; import java.lang.reflect.Method; diff --git a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/LogInterceptor.java b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/LogInterceptor.java index cc315571..452a7f09 100644 --- a/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/LogInterceptor.java +++ b/continew-starter-log/continew-starter-log-interceptor/src/main/java/top/continew/starter/log/interceptor/LogInterceptor.java @@ -29,7 +29,7 @@ import org.springframework.web.servlet.HandlerInterceptor; import top.continew.starter.log.annotation.Log; import top.continew.starter.log.model.LogProperties; import top.continew.starter.log.dao.LogDao; -import top.continew.starter.log.handler.LogHandler; +import top.continew.starter.log.LogHandler; import top.continew.starter.log.model.LogRecord; import java.lang.reflect.Method;