对电子书查询和保存做参数校验
集成spring-boot-starter-validation
对保存接口和查询接口增加参数校验
校验不通过时,前端弹出错误提示
首先pom.xml中添加内置依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
修改: