# ResponseVersion
**Repository Path**: leocode-cn/response-version
## Basic Information
- **Project Name**: ResponseVersion
- **Description**: 根据自定义请求头获取版本号,将响应数据重写为配置文件中配置的版本号对应的全局统一响应结构。
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: https://gitee.com/leocode-cn/response-version
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-10-13
- **Last Updated**: 2023-10-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# ResponseVersion
#### 介绍
根据自定义请求头获取版本号,将响应数据重写为配置文件中配置的版本号对应的全局统一响应结构.
#### 软件架构
使用JDK1.8版本搭建的SpringBoot项目启动模块.
#### 安装教程
1. 在自己SpringBoot项目中引入以下maven依赖.
```
    /* 引入SpringBootWeb启动包 */
    
            org.springframework.boot
            spring-boot-starter-web
            2.7.12
    
    /* 引入本项目JSON响应模块启动包,后续如有其它包,请自行查找替换该依赖即可. */
    
        cn.leocode.module
        leocode-spring-boot-starter-response-json
        2023.0.0.0
    
```
2. 新建统一响应格式类实现cn.leocode.module.response.json.ResponseResult接口并实现方法
3. 在SpringBoot配置文件中添加leocode.response.json前缀的配置项.
4. 使用maven命令或IDEA中的构建工具构建项目
5. 启动项目进行测试
#### 使用说明
SpringBoot配置项说明:
| 配置项                            | 描述             |
|--------------------------------|----------------|
| leocode.response.json          | JSON响应格式配置项前缀  |
| leocode.response.json.enable   | 是否启用JSON格式响应转换 |
| leocode.response.json.header   | 请求头版本字段名称      |
| leocode.response.json.versions | 版本与响应结果类的映射表   |
#### 参与贡献
Pull Request 和 Issue模板 请在.gitee目录中查看
1. Fork 本仓库dev分支
2. 新建 resp_{用户名}_{日期} 分支
3. 提交代码
4. 新建 Pull Request