Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fengwenyi/api-result
一套API接口响应参数规范化解决方案
https://github.com/fengwenyi/api-result
api api-result spring-boot
Last synced: 19 days ago
JSON representation
一套API接口响应参数规范化解决方案
- Host: GitHub
- URL: https://github.com/fengwenyi/api-result
- Owner: fengwenyi
- License: mit
- Created: 2019-08-05T10:27:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T13:02:03.000Z (2 months ago)
- Last Synced: 2024-10-14T01:08:42.032Z (about 1 month ago)
- Topics: api, api-result, spring-boot
- Language: Java
- Homepage: https://www.yuque.com/fengwenyi/quick-forge/ukdeao
- Size: 210 KB
- Stars: 24
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
api-result
一套RESTful风格API接口响应参数规范化的解决方案。## 特性
- 规范化。
- 统一化。
- 标准化。## 快速开始
### Maven
```xml
com.fengwenyi
api-result
3.0.0```
### 代码示例
```java
@RestController
@RequestMapping("/api")
public class ApiController {@RequestMapping("/demo")
public ResultTemplate demo() {
return ResultTemplate.success();
}}
```### 请求
```shell
curl http://localhost:8080/api/demo
```### 响应示例
```json
{
"code":"SUCCESS",
"message":"Success",
"success":true,
"header":null,
"body":null,
"date":"2022-07-16T20:21:23.017"
}
```## 其他
- [文档](https://www.yuque.com/fengwenyi/api-result)
- [Maven仓库](https://mvnrepository.com/artifact/com.fengwenyi/api-result)
- [更新日志](LOG.md)