Skip to content

开箱即用的RestFul SpringBoot项目,包括👻全局统一的响应结构,👽参数校验,👾异常处理,😺配置文件读取

Notifications You must be signed in to change notification settings

yyconstantine/RestFul-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RestFul-Practice


  • 🎈 RestFul API实践

- 对GET/POST/PUT/DELETE请求方法的uri演示,实践了RestFul对uri的规范
- 🍕 全局统一响应结构
- 定义全局统一的响应结构,并引入成功/错误的枚举值定义不同的返回,简化了Controller层的代码,并根据结构体的取值(是否为null)返回不同的结果
- 🥖 全局统一异常处理
- 自定义了异常处理,重写错误信息及错误堆栈信息的打印,并在错误处理中进行拦截,返回自定义的处理逻辑
- 🎲 参数校验及快速返回
- 使用Spring Validation,避免Controller冗余业务校验代码,配置检查到错误后直接返回
- 🍙 Swagger API-Doc
- 使用SpringFox Swagger 2.9.2,演示了常用Demo,对接前端更加轻松

About

开箱即用的RestFul SpringBoot项目,包括👻全局统一的响应结构,👽参数校验,👾异常处理,😺配置文件读取

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages