refactor: 移除 web-core,融合 web-core 和 core 模块

1.移除 web-core,融合 web-core 和 core 模块
2.调整部分依赖顺序
This commit is contained in:
2025-05-22 21:49:20 +08:00
parent 4f9e1ba108
commit f83a901626
56 changed files with 166 additions and 256 deletions

View File

@@ -153,6 +153,10 @@ continew-starter
│ └─ continew-starter-json-jackson │ └─ continew-starter-json-jackson
├─ continew-starter-api-doc接口文档模块Spring Doc + Knife4j ├─ continew-starter-api-doc接口文档模块Spring Doc + Knife4j
├─ continew-starter-webWeb 开发模块:包含跨域、全局异常+响应、链路追踪等自动配置) ├─ continew-starter-webWeb 开发模块:包含跨域、全局异常+响应、链路追踪等自动配置)
├─ continew-starter-cache缓存模块
│ ├─ continew-starter-cache-redissonRedisson
│ ├─ continew-starter-cache-jetcacheJetCache 多级缓存)
│ └─ continew-starter-cache-springcacheSpring 缓存)
├─ continew-starter-auth认证模块 ├─ continew-starter-auth认证模块
│ ├─ continew-starter-auth-satoken国产轻量认证鉴权 │ ├─ continew-starter-auth-satoken国产轻量认证鉴权
│ └─ continew-starter-auth-justauth第三方登录 │ └─ continew-starter-auth-justauth第三方登录
@@ -160,10 +164,6 @@ continew-starter
│ ├─ continew-starter-data-core通用模块 │ ├─ continew-starter-data-core通用模块
│ ├─ continew-starter-data-mpMyBatis Plus │ ├─ continew-starter-data-mpMyBatis Plus
│ └─ continew-starter-data-mfMyBatis Flex │ └─ continew-starter-data-mfMyBatis Flex
├─ continew-starter-cache缓存模块
│ ├─ continew-starter-cache-redissonRedisson
│ ├─ continew-starter-cache-jetcacheJetCache 多级缓存)
│ └─ continew-starter-cache-springcacheSpring 缓存)
├─ continew-starter-security安全模块 ├─ continew-starter-security安全模块
│ ├─ continew-starter-security-crypto加密字段加解密 │ ├─ continew-starter-security-crypto加密字段加解密
│ ├─ continew-starter-security-xssXSS 过滤) │ ├─ continew-starter-security-xssXSS 过滤)

View File

@@ -13,16 +13,16 @@
<description>ContiNew Starter API 文档模块</description> <description>ContiNew Starter API 文档模块</description>
<dependencies> <dependencies>
<!-- Knife4j前身是 swagger-bootstrap-ui集 Swagger2 和 OpenAPI3 为一体的增强解决方案) -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
</dependency>
<!-- 核心模块 --> <!-- 核心模块 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-core</artifactId> <artifactId>continew-starter-core</artifactId>
</dependency> </dependency>
<!-- Knife4j前身是 swagger-bootstrap-ui集 Swagger2 和 OpenAPI3 为一体的增强解决方案) -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -13,6 +13,13 @@
<description>ContiNew Starter 认证模块 - JustAuth</description> <description>ContiNew Starter 认证模块 - JustAuth</description>
<dependencies> <dependencies>
<!-- 缓存模块 - Redisson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
<optional>true</optional>
</dependency>
<!-- Just Auth开箱即用的整合第三方登录的开源组件脱离繁琐的第三方登录 SDK让登录变得 So easy! --> <!-- Just Auth开箱即用的整合第三方登录的开源组件脱离繁琐的第三方登录 SDK让登录变得 So easy! -->
<dependency> <dependency>
<groupId>me.zhyd.oauth</groupId> <groupId>me.zhyd.oauth</groupId>
@@ -23,12 +30,5 @@
<groupId>com.xkcoding.justauth</groupId> <groupId>com.xkcoding.justauth</groupId>
<artifactId>justauth-spring-boot-starter</artifactId> <artifactId>justauth-spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- 缓存模块 - Redisson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -13,12 +13,6 @@
<description>ContiNew Starter 认证模块 - SaToken</description> <description>ContiNew Starter 认证模块 - SaToken</description>
<dependencies> <dependencies>
<!-- Web 模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId>
</dependency>
<!-- 缓存模块 - Redisson --> <!-- 缓存模块 - Redisson -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
@@ -30,12 +24,6 @@
<dependency> <dependency>
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot3-starter</artifactId> <artifactId>sa-token-spring-boot3-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- Sa-Token 整合 JWT --> <!-- Sa-Token 整合 JWT -->

View File

@@ -37,17 +37,29 @@
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Web 模块 - 核心模块 --> <!-- Web 模块 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId> <artifactId>continew-starter-web</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Web 模块 - 增强支持模块 --> <!-- 缓存模块 - Redisson -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-web-support</artifactId> <artifactId>continew-starter-cache-redisson</artifactId>
<version>${revision}</version>
</dependency>
<!-- 缓存模块 - Spring Cache -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-springcache</artifactId>
<version>${revision}</version>
</dependency>
<!-- 缓存模块 - JetCache -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-jetcache</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
@@ -83,25 +95,6 @@
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- 缓存模块 - Redisson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
<version>${revision}</version>
</dependency>
<!-- 缓存模块 - Spring Cache -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-springcache</artifactId>
<version>${revision}</version>
</dependency>
<!-- 缓存模块 - JetCache -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-jetcache</artifactId>
<version>${revision}</version>
</dependency>
<!-- 安全模块 - 密码编码器 --> <!-- 安全模块 - 密码编码器 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>

View File

@@ -13,6 +13,12 @@
<description>ContiNew Starter 缓存模块 - JetCache</description> <description>ContiNew Starter 缓存模块 - JetCache</description>
<dependencies> <dependencies>
<!-- 缓存模块 - Redisson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
</dependency>
<!-- JetCache基于 Java 的缓存系统封装,提供统一的 API 和注解来简化缓存的使用。提供了比 SpringCache 更加强大的注解,可以原生的支持 TTL、两级缓存、分布式自动刷新还提供了 Cache 接口用于手工缓存操作) --> <!-- JetCache基于 Java 的缓存系统封装,提供统一的 API 和注解来简化缓存的使用。提供了比 SpringCache 更加强大的注解,可以原生的支持 TTL、两级缓存、分布式自动刷新还提供了 Cache 接口用于手工缓存操作) -->
<dependency> <dependency>
<groupId>com.alicp.jetcache</groupId> <groupId>com.alicp.jetcache</groupId>
@@ -41,11 +47,5 @@
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId> <artifactId>commons-pool2</artifactId>
</dependency> </dependency>
<!-- 缓存模块 - Redisson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -13,16 +13,16 @@
<description>ContiNew Starter 验证码模块 - 行为验证码</description> <description>ContiNew Starter 验证码模块 - 行为验证码</description>
<dependencies> <dependencies>
<!-- AJ-Captcha行为验证码包含滑动拼图、文字点选两种方式UI支持弹出和嵌入两种方式 -->
<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>captcha</artifactId>
</dependency>
<!-- 缓存模块 - Redisson --> <!-- 缓存模块 - Redisson -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId> <artifactId>continew-starter-cache-redisson</artifactId>
</dependency> </dependency>
<!-- AJ-Captcha行为验证码包含滑动拼图、文字点选两种方式UI支持弹出和嵌入两种方式 -->
<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>captcha</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -29,6 +29,24 @@
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependency>
<!-- Spring Web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<!-- Jakarta Servlet原 Javax Servlet -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<!-- Hibernate Validator --> <!-- Hibernate Validator -->
<dependency> <dependency>
<groupId>org.hibernate.validator</groupId> <groupId>org.hibernate.validator</groupId>

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package top.continew.starter.web.util; package top.continew.starter.core.util;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
@@ -43,6 +43,7 @@ import java.time.LocalDateTime;
* @since 1.0.0 * @since 1.0.0
*/ */
public class FileUploadUtils { public class FileUploadUtils {
private static final Logger log = LoggerFactory.getLogger(FileUploadUtils.class); private static final Logger log = LoggerFactory.getLogger(FileUploadUtils.class);
private FileUploadUtils() { private FileUploadUtils() {

View File

@@ -14,13 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
package top.continew.starter.web.util; package top.continew.starter.core.util;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.extra.servlet.JakartaServletUtil; import cn.hutool.extra.servlet.JakartaServletUtil;
import cn.hutool.http.useragent.UserAgent; import cn.hutool.http.useragent.UserAgent;
import cn.hutool.http.useragent.UserAgentUtil; import cn.hutool.http.useragent.UserAgentUtil;
import cn.hutool.json.JSONUtil;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
@@ -29,7 +30,8 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.util.UriUtils; import org.springframework.web.util.UriUtils;
import top.continew.starter.core.constant.StringConstants; import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.json.jackson.util.JSONUtils; import top.continew.starter.core.wrapper.RepeatReadRequestWrapper;
import top.continew.starter.core.wrapper.RepeatReadResponseWrapper;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@@ -204,7 +206,7 @@ public class ServletUtils extends JakartaServletUtil {
HttpServletRequest request = getRequest(); HttpServletRequest request = getRequest();
if (request instanceof RepeatReadRequestWrapper wrapper && !wrapper.isMultipartContent(request)) { if (request instanceof RepeatReadRequestWrapper wrapper && !wrapper.isMultipartContent(request)) {
String body = JakartaServletUtil.getBody(request); String body = JakartaServletUtil.getBody(request);
return JSONUtils.isTypeJSON(body) ? body : null; return JSONUtil.isTypeJSON(body) ? body : null;
} }
return null; return null;
} }
@@ -217,8 +219,8 @@ public class ServletUtils extends JakartaServletUtil {
*/ */
public static Map<String, Object> getRequestParams() { public static Map<String, Object> getRequestParams() {
String body = getRequestBody(); String body = getRequestBody();
return CharSequenceUtil.isNotBlank(body) && JSONUtils.isTypeJSON(body) return CharSequenceUtil.isNotBlank(body) && JSONUtil.isTypeJSON(body)
? JSONUtils.toBean(body, Map.class) ? JSONUtil.toBean(body, Map.class)
: Collections.unmodifiableMap(JakartaServletUtil.getParamMap(Objects.requireNonNull(getRequest()))); : Collections.unmodifiableMap(JakartaServletUtil.getParamMap(Objects.requireNonNull(getRequest())));
} }
@@ -262,7 +264,7 @@ public class ServletUtils extends JakartaServletUtil {
HttpServletResponse response = getResponse(); HttpServletResponse response = getResponse();
if (response instanceof RepeatReadResponseWrapper wrapper && !wrapper.isStreamingResponse()) { if (response instanceof RepeatReadResponseWrapper wrapper && !wrapper.isStreamingResponse()) {
String body = wrapper.getResponseContent(); String body = wrapper.getResponseContent();
return JSONUtils.isTypeJSON(body) ? body : null; return JSONUtil.isTypeJSON(body) ? body : null;
} }
return null; return null;
} }
@@ -275,9 +277,7 @@ public class ServletUtils extends JakartaServletUtil {
*/ */
public static Map<String, Object> getResponseParams() { public static Map<String, Object> getResponseParams() {
String body = getResponseBody(); String body = getResponseBody();
return CharSequenceUtil.isNotBlank(body) && JSONUtils.isTypeJSON(body) return CharSequenceUtil.isNotBlank(body) && JSONUtil.isTypeJSON(body) ? JSONUtil.toBean(body, Map.class) : null;
? JSONUtils.toBean(body, Map.class)
: null;
} }
/** /**

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package top.continew.starter.web.util; package top.continew.starter.core.util;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.ReflectUtil;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package top.continew.starter.web.util; package top.continew.starter.core.wrapper;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import jakarta.servlet.ReadListener; import jakarta.servlet.ReadListener;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package top.continew.starter.web.util; package top.continew.starter.core.wrapper;
import jakarta.servlet.ServletOutputStream; import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.WriteListener; import jakarta.servlet.WriteListener;

View File

@@ -13,9 +13,10 @@
<description>ContiNew Starter 数据访问模块 - MyBatis Flex</description> <description>ContiNew Starter 数据访问模块 - MyBatis Flex</description>
<dependencies> <dependencies>
<!-- 数据访问模块 - 核心模块 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>top.continew</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>continew-starter-data-core</artifactId>
</dependency> </dependency>
<!-- MyBatis PlusMyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率) --> <!-- MyBatis PlusMyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率) -->
@@ -29,12 +30,6 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- 数据访问模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-data-core</artifactId>
</dependency>
<!-- CosId通用、灵活、高性能的分布式 ID 生成器) --> <!-- CosId通用、灵活、高性能的分布式 ID 生成器) -->
<dependency> <dependency>
<groupId>me.ahoo.cosid</groupId> <groupId>me.ahoo.cosid</groupId>

View File

@@ -13,6 +13,12 @@
<description>ContiNew Starter 数据访问模块 - MyBatis Plus</description> <description>ContiNew Starter 数据访问模块 - MyBatis Plus</description>
<dependencies> <dependencies>
<!-- 数据访问模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-data-core</artifactId>
</dependency>
<!-- MyBatis PlusMyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率) --> <!-- MyBatis PlusMyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率) -->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
@@ -25,12 +31,6 @@
<artifactId>p6spy</artifactId> <artifactId>p6spy</artifactId>
</dependency> </dependency>
<!-- 数据访问模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-data-core</artifactId>
</dependency>
<!-- CosId通用、灵活、高性能的分布式 ID 生成器) --> <!-- CosId通用、灵活、高性能的分布式 ID 生成器) -->
<dependency> <dependency>
<groupId>me.ahoo.cosid</groupId> <groupId>me.ahoo.cosid</groupId>

View File

@@ -13,21 +13,16 @@
<description>ContiNew Starter 扩展模块 - CRUD增删改查 - 核心模块</description> <description>ContiNew Starter 扩展模块 - CRUD增删改查 - 核心模块</description>
<dependencies> <dependencies>
<!-- Crane4j基于注解的用于完成一切 “根据 A 的 key 值拿到 B再把 B 的属性映射到 A” 这类需求的字段填充框架) --> <!-- API 文档模块 -->
<dependency>
<groupId>cn.crane4j</groupId>
<artifactId>crane4j-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<!-- Web 模块 - 增强支持模块 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-web-support</artifactId> <artifactId>continew-starter-api-doc</artifactId>
</dependency>
<!-- Web 模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web</artifactId>
</dependency> </dependency>
<!-- 数据访问模块 - 核心模块 --> <!-- 数据访问模块 - 核心模块 -->
@@ -42,10 +37,10 @@
<artifactId>continew-starter-file-excel</artifactId> <artifactId>continew-starter-file-excel</artifactId>
</dependency> </dependency>
<!-- API 文档模块 --> <!-- Crane4j基于注解的用于完成一切 “根据 A 的 key 值拿到 B再把 B 的属性映射到 A” 这类需求的字段填充框架) -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>cn.crane4j</groupId>
<artifactId>continew-starter-api-doc</artifactId> <artifactId>crane4j-spring-boot-starter</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -18,11 +18,5 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
</dependency> </dependency>
<!-- Jakarta原 Javax Servlet -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -11,7 +11,6 @@
<artifactId>continew-starter-log-aop</artifactId> <artifactId>continew-starter-log-aop</artifactId>
<description>ContiNew Starter 日志模块 - 基于 AOP 实现</description> <description>ContiNew Starter 日志模块 - 基于 AOP 实现</description>
<dependencies> <dependencies>
<!-- 日志模块 - 核心模块 --> <!-- 日志模块 - 核心模块 -->
<dependency> <dependency>

View File

@@ -25,8 +25,8 @@ import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.lang.NonNull; import org.springframework.lang.NonNull;
import org.springframework.web.filter.OncePerRequestFilter; import org.springframework.web.filter.OncePerRequestFilter;
import top.continew.starter.web.util.RepeatReadRequestWrapper; import top.continew.starter.core.wrapper.RepeatReadRequestWrapper;
import top.continew.starter.web.util.RepeatReadResponseWrapper; import top.continew.starter.core.wrapper.RepeatReadResponseWrapper;
import top.continew.starter.log.model.LogProperties; import top.continew.starter.log.model.LogProperties;
import java.io.IOException; import java.io.IOException;

View File

@@ -31,7 +31,7 @@ import top.continew.starter.log.model.AccessLogContext;
import top.continew.starter.log.model.AccessLogProperties; import top.continew.starter.log.model.AccessLogProperties;
import top.continew.starter.log.model.LogRecord; import top.continew.starter.log.model.LogRecord;
import top.continew.starter.log.util.AccessLogUtils; import top.continew.starter.log.util.AccessLogUtils;
import top.continew.starter.web.util.ServletUtils; import top.continew.starter.core.util.ServletUtils;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.time.Duration; import java.time.Duration;

View File

@@ -20,7 +20,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.boot.context.properties.NestedConfigurationProperty;
import top.continew.starter.core.constant.PropertiesConstants; import top.continew.starter.core.constant.PropertiesConstants;
import top.continew.starter.log.enums.Include; import top.continew.starter.log.enums.Include;
import top.continew.starter.web.util.SpringWebUtils; import top.continew.starter.core.util.SpringWebUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -20,7 +20,7 @@ import cn.hutool.core.text.CharSequenceUtil;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import top.continew.starter.core.util.ExceptionUtils; import top.continew.starter.core.util.ExceptionUtils;
import top.continew.starter.core.util.IpUtils; import top.continew.starter.core.util.IpUtils;
import top.continew.starter.web.util.ServletUtils; import top.continew.starter.core.util.ServletUtils;
import top.continew.starter.log.enums.Include; import top.continew.starter.log.enums.Include;
import java.net.URI; import java.net.URI;

View File

@@ -17,7 +17,7 @@
package top.continew.starter.log.model; package top.continew.starter.log.model;
import top.continew.starter.log.enums.Include; import top.continew.starter.log.enums.Include;
import top.continew.starter.web.util.ServletUtils; import top.continew.starter.core.util.ServletUtils;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;

View File

@@ -18,12 +18,11 @@ package top.continew.starter.log.util;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.JsonNode; import cn.hutool.json.JSONUtil;
import top.continew.starter.json.jackson.util.JSONUtils;
import top.continew.starter.log.model.AccessLogProperties; import top.continew.starter.log.model.AccessLogProperties;
import top.continew.starter.log.model.LogProperties; import top.continew.starter.log.model.LogProperties;
import top.continew.starter.web.util.ServletUtils; import top.continew.starter.core.util.ServletUtils;
import top.continew.starter.web.util.SpringWebUtils; import top.continew.starter.core.util.SpringWebUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -79,7 +78,7 @@ public class AccessLogUtils {
params = processTruncateLongParams(params, properties.getLongParamThreshold(), properties params = processTruncateLongParams(params, properties.getLongParamThreshold(), properties
.getLongParamMaxLength(), properties.getLongParamSuffix()); .getLongParamMaxLength(), properties.getLongParamSuffix());
} }
return JSONUtils.toJsonStr(params); return JSONUtil.toJsonStr(params);
} }
/** /**
@@ -192,13 +191,12 @@ public class AccessLogUtils {
*/ */
private static Object getAccessLogReqParam() { private static Object getAccessLogReqParam() {
String body = ServletUtils.getRequestBody(); String body = ServletUtils.getRequestBody();
if (CharSequenceUtil.isNotBlank(body) && JSONUtils.isTypeJSON(body)) { if (CharSequenceUtil.isNotBlank(body) && JSONUtil.isTypeJSON(body)) {
try { try {
JsonNode jsonNode = JSONUtils.getObjectMapper().readTree(body); if (JSONUtil.isTypeJSONArray(body)) {
if (jsonNode.isArray()) { return JSONUtil.toBean(body, List.class);
return JSONUtils.toBean(body, List.class);
} else { } else {
return JSONUtils.toBean(body, Map.class); return JSONUtil.toBean(body, Map.class);
} }
} catch (Exception e) { } catch (Exception e) {
return null; return null;

View File

@@ -20,10 +20,10 @@
</modules> </modules>
<dependencies> <dependencies>
<!-- Web 模块 - 核心模块 --> <!-- 核心模块 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId> <artifactId>continew-starter-core</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -11,10 +11,10 @@
<description>ContiNew Starter 限流模块</description> <description>ContiNew Starter 限流模块</description>
<dependencies> <dependencies>
<!-- Web 模块 - 核心模块 --> <!-- 核心模块 -->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId> <artifactId>continew-starter-core</artifactId>
</dependency> </dependency>
<!-- 缓存模块 - Redisson --> <!-- 缓存模块 - Redisson -->

View File

@@ -34,7 +34,7 @@ import top.continew.starter.ratelimiter.autoconfigure.RateLimiterProperties;
import top.continew.starter.ratelimiter.generator.RateLimiterNameGenerator; import top.continew.starter.ratelimiter.generator.RateLimiterNameGenerator;
import top.continew.starter.ratelimiter.enums.LimitType; import top.continew.starter.ratelimiter.enums.LimitType;
import top.continew.starter.ratelimiter.exception.RateLimiterException; import top.continew.starter.ratelimiter.exception.RateLimiterException;
import top.continew.starter.web.util.ServletUtils; import top.continew.starter.core.util.ServletUtils;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.time.Duration; import java.time.Duration;

View File

@@ -11,12 +11,4 @@
<artifactId>continew-starter-security-xss</artifactId> <artifactId>continew-starter-security-xss</artifactId>
<description>ContiNew Starter 安全模块 - XSS 过滤模块</description> <description>ContiNew Starter 安全模块 - XSS 过滤模块</description>
<dependencies>
<!-- Web 模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId>
</dependency>
</dependencies>
</project> </project>

View File

@@ -22,7 +22,7 @@ import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import top.continew.starter.security.xss.autoconfigure.XssProperties; import top.continew.starter.security.xss.autoconfigure.XssProperties;
import top.continew.starter.web.util.SpringWebUtils; import top.continew.starter.core.util.SpringWebUtils;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

View File

@@ -12,19 +12,16 @@
<description>ContiNew Starter 存储模块 - 核心模块</description> <description>ContiNew Starter 存储模块 - 核心模块</description>
<dependencies> <dependencies>
<!-- 缓存模块 - Redisson -->
<!--redisson 缓存模块-->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId> <artifactId>continew-starter-cache-redisson</artifactId>
</dependency> </dependency>
<!--图片处理工具-主要用做图片缩略处理--> <!-- Thumbnailator缩略图生成库 -->
<dependency> <dependency>
<groupId>net.coobird</groupId> <groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId> <artifactId>thumbnailator</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -13,7 +13,7 @@
<description>ContiNew Starter 存储模块 - 本地存储</description> <description>ContiNew Starter 存储模块 - 本地存储</description>
<dependencies> <dependencies>
<!--存储 - 核心模块--> <!-- 存储模块 - 核心模块-->
<dependency> <dependency>
<groupId>top.continew</groupId> <groupId>top.continew</groupId>
<artifactId>continew-starter-storage-core</artifactId> <artifactId>continew-starter-storage-core</artifactId>

View File

@@ -12,6 +12,12 @@
<description>ContiNew Starter 存储模块 - 对象存储</description> <description>ContiNew Starter 存储模块 - 对象存储</description>
<dependencies> <dependencies>
<!-- 存储模块 - 核心模块-->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-storage-core</artifactId>
</dependency>
<!-- S3 SDK for Java 2.x --> <!-- S3 SDK for Java 2.x -->
<dependency> <dependency>
<groupId>software.amazon.awssdk</groupId> <groupId>software.amazon.awssdk</groupId>
@@ -51,13 +57,5 @@
<groupId>software.amazon.awssdk</groupId> <groupId>software.amazon.awssdk</groupId>
<artifactId>s3-transfer-manager</artifactId> <artifactId>s3-transfer-manager</artifactId>
</dependency> </dependency>
<!--存储 - 核心模块-->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-storage-core</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -19,12 +19,6 @@
<artifactId>continew-starter-core</artifactId> <artifactId>continew-starter-core</artifactId>
</dependency> </dependency>
<!-- Servlet API -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<!-- TLog轻量级的分布式日志标记追踪神器 --> <!-- TLog轻量级的分布式日志标记追踪神器 -->
<dependency> <dependency>
<groupId>com.yomahub</groupId> <groupId>com.yomahub</groupId>

View File

@@ -1,46 +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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web</artifactId>
<version>${revision}</version>
</parent>
<artifactId>continew-starter-web-core</artifactId>
<description>ContiNew Starter Web 模块 - 核心模块</description>
<dependencies>
<!-- 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-core</artifactId>
</dependency>
<!-- JSON 模块 - Jackson -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-json-jackson</artifactId>
</dependency>
<!-- Spring Boot Web提供 Spring MVC Web 开发能力,默认内置 Tomcat 服务器) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 移除内置 Tomcat 服务器 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Servlet API -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,40 +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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web</artifactId>
<version>${revision}</version>
</parent>
<artifactId>continew-starter-web-support</artifactId>
<description>ContiNew Starter Web 模块 - 增强支持模块</description>
<dependencies>
<!-- Web 模块 - 核心模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-web-core</artifactId>
</dependency>
<!-- API 文档模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-api-doc</artifactId>
<optional>true</optional>
</dependency>
<!-- Undertow 服务器(采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!-- Graceful ResponseSpring Boot技术栈下的优雅响应处理组件可以帮助开发者完成响应数据封装、异常处理、错误码填充等过程提高开发效率提高代码质量 -->
<dependency>
<groupId>com.feiniaojin</groupId>
<artifactId>graceful-response</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -9,12 +9,46 @@
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<packaging>pom</packaging>
<artifactId>continew-starter-web</artifactId> <artifactId>continew-starter-web</artifactId>
<description>ContiNew Starter Web 模块</description> <description>ContiNew Starter Web 模块</description>
<modules> <dependencies>
<module>continew-starter-web-core</module> <!-- JSON 模块 - Jackson -->
<module>continew-starter-web-support</module> <dependency>
</modules> <groupId>top.continew</groupId>
<artifactId>continew-starter-json-jackson</artifactId>
</dependency>
<!-- API 文档模块 -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-api-doc</artifactId>
<optional>true</optional>
</dependency>
<!-- Spring Boot Web提供 Spring MVC Web 开发能力,默认内置 Tomcat 服务器) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 移除内置 Tomcat 服务器 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Undertow 服务器(采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!-- Graceful Response一个Spring Boot技术栈下的优雅响应处理组件可以帮助开发者完成响应数据封装、异常处理、错误码填充等过程提高开发效率提高代码质量 -->
<dependency>
<groupId>com.feiniaojin</groupId>
<artifactId>graceful-response</artifactId>
</dependency>
</dependencies>
</project> </project>

View File

@@ -38,9 +38,9 @@
<module>continew-starter-json</module> <module>continew-starter-json</module>
<module>continew-starter-api-doc</module> <module>continew-starter-api-doc</module>
<module>continew-starter-web</module> <module>continew-starter-web</module>
<module>continew-starter-cache</module>
<module>continew-starter-auth</module> <module>continew-starter-auth</module>
<module>continew-starter-data</module> <module>continew-starter-data</module>
<module>continew-starter-cache</module>
<module>continew-starter-security</module> <module>continew-starter-security</module>
<module>continew-starter-ratelimiter</module> <module>continew-starter-ratelimiter</module>
<module>continew-starter-idempotent</module> <module>continew-starter-idempotent</module>