项目作者: IsZouTao

项目描述 :
基于Spring AOP的Controller增强器实现的统一响应
高级语言: Java
项目地址: git://github.com/IsZouTao/springboot-Unified-data-return.git
创建时间: 2020-04-16T14:28:17Z
项目社区:https://github.com/IsZouTao/springboot-Unified-data-return

开源协议:BSD 3-Clause "New" or "Revised" License

下载


快速入门

基于Spring AOP的Controller增强器实现的统一响应示例

其中对高并发的一些基本数据类型进行了使用,本程序结构可用于高并发的web项目。

背景

本项目是为了解决HTTP接口返回统一格式的JSON body问题。

运行环境

  1. JDK 1.8或以上版本
  2. maven 3.1.0或以上版本
  3. 安装lombok插件
  4. springboot2.x版本

快速启动

  1. 运行SpringWebParamValidateDemoApplicationmain方法即可启动项目
  2. 然后在浏览器/postman工具中进行以下操作就可以看到统一响应体的示例运行效果了
    1. 访问http://locahost:8080/users/0,返回结果如下:
      1. {
      2. "code": 404,
      3. "msg": "资源不存在",
      4. "data": null
      5. }

对应博文讲解地址:
https://blog.csdn.net/ITBigGod/article/details/105567916

更多接口规范:
https://blog.csdn.net/ITBigGod/article/details/105560158

2020/4/16