Skip to content
JIAN-JUN-MENG edited this page Jul 23, 2024 · 8 revisions

1.0.0 JAR包下载

<!-- https://mvnrepository.com/artifact/com.mambaart/validate-param -->
<dependency>
    <groupId>com.mambaart</groupId>
    <artifactId>validate-param</artifactId>
    <version>1.0.0</version>
</dependency>

1.1.1 JAR包下载

增加@RemoveSpace注解,移除前后空格
<!-- https://mvnrepository.com/artifact/com.mambaart/validate-param -->
<dependency>
    <groupId>com.mambaart</groupId>
    <artifactId>validate-param</artifactId>
    <version>1.1.1</version>
</dependency>

前言:

没有返回参数验证错误提示的接口不是好接口

没有验证参数的接口不算接口

引入本项目可以实现

  1. 验证接口参数的合法性(验证字段除对象,必须为String类型)

  2. 打印接口参数日志,接口返回结果日志

  3. 接口公共验签

使用注意

  1. Spring 扫描 @ComponentScan({"com.github.星号星号","自己项目包的扫描路径.星号星号"})

  2. 接口加上 @ValidateParameter 注解

  3. 接口返回值为 ValidateResult;

Clone this wiki locally