You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.3 KiB
81 lines
1.3 KiB
#### 通用请求
|
|
|
|
```json
|
|
{
|
|
"key_xx": "value_xx「任意类型值」",
|
|
"key_yy": "value_yy「任意类型值」"
|
|
}
|
|
```
|
|
|
|
#### 通用正确返回
|
|
|
|
```json
|
|
{
|
|
"code": 200,
|
|
"data": {
|
|
"key_xx": "value_xx「任意类型值」",
|
|
"key_yy": "value_yy「任意类型值」"
|
|
}, // data必须是对象
|
|
"message": "success"
|
|
}
|
|
```
|
|
|
|
#### 通用错误返回
|
|
|
|
```json
|
|
{
|
|
// 错误码,跟 http-status 一致,并且在 grpc 中可以转换成 grpc-status
|
|
"code": 500,
|
|
// 错误原因,定义为业务判定错误码
|
|
"reason": "USER_NOT_FOUND",
|
|
// 错误信息,为用户可读的信息,可作为用户提示内容
|
|
"message": "invalid argument error"
|
|
}
|
|
```
|
|
|
|
#### 列表请求
|
|
|
|
```json
|
|
{
|
|
"page": 1,
|
|
"per_page": 10,
|
|
"key_xx": "value_xx「任意类型值」"
|
|
}
|
|
```
|
|
|
|
#### 列表返回
|
|
|
|
```json
|
|
{
|
|
"code": 200,
|
|
"data": {
|
|
"page": 1,
|
|
"per_page": 10,
|
|
"total": 1000,
|
|
"list": ["xxx「任意类型值」"]
|
|
},
|
|
"message": "success"
|
|
}
|
|
```
|
|
|
|
------
|
|
|
|
#### 高级检索value格式
|
|
|
|
```json
|
|
[
|
|
{
|
|
"operator":"AND",
|
|
"field":"name",
|
|
"value":["value_xxx"]
|
|
}
|
|
]
|
|
```
|
|
|
|
-----
|
|
|
|
#### 说明
|
|
|
|
- 命名统一蛇形,如:per_page
|
|
- 通用字段统一,排序:sort
|
|
- 空的处理方式,对应类型的空值(数组:[],字符串:"",数值:0,对象:null) |