Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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接口响应参数规范化解决方案

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)