Skip to content

Commit 5ae5b26

Browse files
committed
feat(validation): 新增校验模块并引入 SpEL Validator 用于复杂校验场景
1 parent 5a53d95 commit 5ae5b26

File tree

31 files changed

+91
-34
lines changed

31 files changed

+91
-34
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ continew-starter
152152
├─ continew-starter-json(JSON 模块)
153153
│ └─ continew-starter-json-jackson
154154
├─ continew-starter-api-doc(接口文档模块:Spring Doc + Knife4j)
155+
├─ continew-starter-validation(校验模块:Hibernate Validator)
155156
├─ continew-starter-web(Web 开发模块:包含跨域、全局异常+响应、链路追踪等自动配置)
156157
├─ continew-starter-cache(缓存模块)
157158
│ ├─ continew-starter-cache-redisson(Redisson)
@@ -161,7 +162,7 @@ continew-starter
161162
│ ├─ continew-starter-auth-satoken(国产轻量认证鉴权)
162163
│ └─ continew-starter-auth-justauth(第三方登录)
163164
├─ continew-starter-data(数据访问模块)
164-
│ ├─ continew-starter-data-core(通用模块
165+
│ ├─ continew-starter-data-core(核心模块
165166
│ ├─ continew-starter-data-mp(MyBatis Plus)
166167
│ └─ continew-starter-data-mf(MyBatis Flex)
167168
├─ continew-starter-security(安全模块)
@@ -179,11 +180,13 @@ continew-starter
179180
│ ├─ continew-starter-messaging-mail(邮件)
180181
│ └─ continew-starter-messaging-websocket(WebSocket)
181182
├─ continew-starter-log(日志模块)
182-
│ ├─ continew-starter-log-core(通用模块
183+
│ ├─ continew-starter-log-core(核心模块
183184
│ ├─ continew-starter-log-aop(基于 AOP 实现)
184185
│ └─ continew-starter-log-interceptor(基于拦截器实现(Spring Boot Actuator HttpTrace 增强版))
185-
├─ continew-starter-file(文件处理模块)
186-
│ └─ continew-starter-file-excel(Easy Excel)
186+
├─ continew-starter-excel(Excel 文件处理模块)
187+
│ ├─ continew-starter-excel-core(核心模块)
188+
│ ├─ continew-starter-excel-fastexcel(FastExcel)
189+
│ └─ continew-starter-excel-poi(POI)
187190
├─ continew-starter-storage(存储模块)
188191
│ └─ continew-starter-storage-local(本地存储)
189192
├─ continew-starter-license(License 模块)
@@ -192,13 +195,13 @@ continew-starter
192195
│ └─ continew-starter-license-verifier(License 校验器)
193196
└─ continew-starter-extension(扩展模块)
194197
├─ continew-starter-extension-datapermission(数据权限模块)
195-
│ ├─ continew-starter-extension-datapermission-core(通用模块
198+
│ ├─ continew-starter-extension-datapermission-core(核心模块
196199
│ └─ continew-starter-extension-datapermission-mp(MyBatis Plus)
197200
├─ continew-starter-extension-tenant(多租户模块)
198-
│ ├─ continew-starter-extension-tenant-core(通用模块
201+
│ ├─ continew-starter-extension-tenant-core(核心模块
199202
│ └─ continew-starter-extension-tenant-mp(MyBatis Plus)
200203
└─ continew-starter-extension-crud(CRUD 模块)
201-
├─ continew-starter-extension-crud-core(通用模块
204+
├─ continew-starter-extension-crud-core(核心模块
202205
├─ continew-starter-extension-crud-mp(MyBatis Plus)
203206
└─ continew-starter-extension-crud-mf(MyBatis Flex)
204207
```

continew-starter-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
<version>${revision}</version>
4040
</dependency>
4141

42+
<!-- 校验模块 -->
43+
<dependency>
44+
<groupId>top.continew</groupId>
45+
<artifactId>continew-starter-validation</artifactId>
46+
<version>${revision}</version>
47+
</dependency>
48+
4249
<!-- Web 模块 -->
4350
<dependency>
4451
<groupId>top.continew</groupId>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.starter.core.validation;
17+
package top.continew.starter.core.util;
1818

1919
import cn.hutool.core.text.CharSequenceUtil;
2020
import top.continew.starter.core.constant.StringConstants;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.starter.core.validation;
17+
package top.continew.starter.core.util;
1818

1919
import cn.hutool.core.text.CharSequenceUtil;
2020
import top.continew.starter.core.exception.BadRequestException;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.starter.core.validation;
17+
package top.continew.starter.core.util;
1818

1919
import cn.hutool.core.text.CharSequenceUtil;
2020
import cn.hutool.core.util.ObjectUtil;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
top.continew.starter.core.autoconfigure.project.ProjectAutoConfiguration
2-
top.continew.starter.core.autoconfigure.ValidatorAutoConfiguration
32
top.continew.starter.core.autoconfigure.threadpool.ThreadPoolAutoConfiguration
43
top.continew.starter.core.autoconfigure.threadpool.AsyncAutoConfiguration

continew-starter-data/continew-starter-data-mf/src/main/java/top/continew/starter/data/mf/util/QueryWrapperHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.springframework.data.domain.Sort;
2929
import top.continew.starter.core.exception.BadRequestException;
3030
import top.continew.starter.core.util.ReflectUtils;
31-
import top.continew.starter.core.validation.ValidationUtils;
31+
import top.continew.starter.core.util.ValidationUtils;
3232
import top.continew.starter.data.core.annotation.Query;
3333
import top.continew.starter.data.core.annotation.QueryIgnore;
3434
import top.continew.starter.data.core.enums.QueryType;

continew-starter-data/continew-starter-data-mp/src/main/java/top/continew/starter/data/mp/service/impl/ServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
2121
import com.baomidou.mybatisplus.extension.repository.CrudRepository;
2222
import top.continew.starter.core.util.ReflectUtils;
23-
import top.continew.starter.core.validation.CheckUtils;
2423
import top.continew.starter.data.mp.service.IService;
24+
import top.continew.starter.core.util.CheckUtils;
2525

2626
import java.io.Serializable;
2727
import java.lang.reflect.Field;

continew-starter-data/continew-starter-data-mp/src/main/java/top/continew/starter/data/mp/util/QueryWrapperHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.springframework.data.domain.Sort;
2929
import top.continew.starter.core.exception.BadRequestException;
3030
import top.continew.starter.core.util.ReflectUtils;
31-
import top.continew.starter.core.validation.ValidationUtils;
31+
import top.continew.starter.core.util.ValidationUtils;
3232
import top.continew.starter.data.core.annotation.Query;
3333
import top.continew.starter.data.core.annotation.QueryIgnore;
3434
import top.continew.starter.data.core.enums.QueryType;

continew-starter-dependencies/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<aws-crt.version>0.38.5</aws-crt.version>
4040
<thumbnails.version>0.4.20</thumbnails.version>
4141
<graceful-response.version>5.0.5-boot3</graceful-response.version>
42+
<spel-validator.version>0.5.0-beta</spel-validator.version>
4243
<crane4j.version>2.9.0</crane4j.version>
4344
<knife4j.version>4.5.0</knife4j.version>
4445
<tlog.version>1.5.2</tlog.version>
@@ -266,6 +267,13 @@
266267
<version>${graceful-response.version}</version>
267268
</dependency>
268269

270+
<!-- SpEL Validator(基于 SpEL 的 jakarta.validation-api 扩展增强包) -->
271+
<dependency>
272+
<groupId>cn.sticki</groupId>
273+
<artifactId>spel-validator-javax</artifactId>
274+
<version>${spel-validator.version}</version>
275+
</dependency>
276+
269277
<!-- Crane4j(基于注解的,用于完成一切 “根据 A 的 key 值拿到 B,再把 B 的属性映射到 A” 这类需求的字段填充框架) -->
270278
<dependency>
271279
<groupId>cn.crane4j</groupId>

0 commit comments

Comments
 (0)